Return null for empty generator IDs

This commit is contained in:
Browsit authored and GitHub committed 2024-02-02 08:15:37 -05:00
1 parent f3476c5cc8
commit c52ad56ccc
1 file changed
+1
@@ -189,6 +189,7 @@ public class TerraBukkitPlugin extends JavaPlugin {
@Override
public @Nullable
ChunkGenerator getDefaultWorldGenerator(@NotNull String worldName, String id) {
if (id == null || id.trim().equals("")) { return null; }
return new BukkitChunkGeneratorWrapper(generatorMap.computeIfAbsent(worldName, name -> {
ConfigPack pack = platform.getConfigRegistry().getByID(id).orElseThrow(
() -> new IllegalArgumentException("No such config pack \"" + id + "\""));