When defining generators for worlds that Bukkit loads by default, other plugins may trigger an exception within Terra as they, of course, do not use colons followed by pack IDs. Here is an example of such using PlotSquared on Paper 1.20.4:
[11:45:46] [Server thread/WARN]: java.lang.IllegalArgumentException: No such config pack ""
[11:45:46] [Server thread/WARN]: at Terra-bukkit-6.4.3-BETA+ab60f14ff-shaded.jar//com.dfsek.terra.bukkit.TerraBukkitPlugin.lambda$getDefaultWorldGenerator$2(TerraBukkitPlugin.java:194)
[11:45:46] [Server thread/WARN]: at java.base/java.util.Optional.orElseThrow(Optional.java:403)
[11:45:46] [Server thread/WARN]: at Terra-bukkit-6.4.3-BETA+ab60f14ff-shaded.jar//com.dfsek.terra.bukkit.TerraBukkitPlugin.lambda$getDefaultWorldGenerator$3(TerraBukkitPlugin.java:193)
[11:45:46] [Server thread/WARN]: at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1220)
[11:45:46] [Server thread/WARN]: at Terra-bukkit-6.4.3-BETA+ab60f14ff-shaded.jar//com.dfsek.terra.bukkit.TerraBukkitPlugin.getDefaultWorldGenerator(TerraBukkitPlugin.java:192)
[11:45:46] [Server thread/WARN]: at plotsquared-bukkit-7.3.2-Premium.jar//com.plotsquared.bukkit.util.BukkitSetupUtils.updateGenerators(BukkitSetupUtils.java:80)
[11:45:46] [Server thread/WARN]: at plotsquared-bukkit-7.3.2-Premium.jar//com.plotsquared.bukkit.BukkitPlatform.lambda$onEnable$1(BukkitPlatform.java:444)
[11:45:46] [Server thread/WARN]: at plotsquared-bukkit-7.3.2-Premium.jar//com.plotsquared.bukkit.util.task.BukkitPlotSquaredTask.runTask(BukkitPlotSquaredTask.java:39)
[11:45:46] [Server thread/WARN]: at plotsquared-bukkit-7.3.2-Premium.jar//com.plotsquared.core.util.task.PlotSquaredTask.run(PlotSquaredTask.java:44)
[11:45:46] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftTask.run(CraftTask.java:101)
[11:45:46] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:480)
[11:45:46] [Server thread/WARN]: at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1143)
[11:45:46] [Server thread/WARN]: at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:321)
[11:45:46] [Server thread/WARN]: at java.base/java.lang.Thread.run(Thread.java:833)
This PR resolves the issue by simply returning null when the generator being identified lacks an ID.
[x] The base branch of this PR is an unreleased version branch (that has a ver/ prefix)
or is a branch that is intended to be merged into a version branch.
[x] There are no already existing PRs that provide the same changes.
[x] The PR is within the scope of Terra (i.e. is something a configurable terrain generator should be doing).
[ ] Changes follow the code style for this project.
[x] I have read the CONTRIBUTING.md
document in the root of the git repository.
Types of changes
[x] Bug Fix
[ ] Build system
[ ] Documentation
[ ] New Feature
[ ] Performance
[ ] Refactoring
[ ] Repository
[ ] Revert
[ ] Style
[ ] Tests
[ ] Translation
Compatibility
[ ] Introduces a breaking change
[ ] Introduces new functionality in a backwards compatible way.
[x] Introduces bug fixes
Documentation
[ ] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
Testing
[ ] I have added tests to cover my changes.
[ ] All new and existing tests passed.
Licensing
[x] I am the original author of this code, and I am willing to
release it under GPLv3.
[ ] I am not the original author of this code, but it is in public domain or
released under GPLv3 or a compatible license.
Pull Request
Description
When defining generators for worlds that Bukkit loads by default, other plugins may trigger an exception within Terra as they, of course, do not use colons followed by pack IDs. Here is an example of such using PlotSquared on Paper 1.20.4:
This PR resolves the issue by simply returning null when the generator being identified lacks an ID.
Fixes https://discord.com/channels/715448651786485780/1106498518807494676
Checklist
Mandatory checks
ver/
prefix) or is a branch that is intended to be merged into a version branch.CONTRIBUTING.md
document in the root of the git repository.Types of changes
Compatibility
Documentation
Testing
Licensing