fix bukkit impl

This commit is contained in:
dfsek 2021-12-01 21:14:22 -07:00
parent 4db469199c
commit ed2e56c776

View File

@ -205,11 +205,10 @@ public class TerraBukkitPlugin extends JavaPlugin {
@Override @Override
public @Nullable public @Nullable
ChunkGenerator getDefaultWorldGenerator(@NotNull String worldName, @Nullable String id) { ChunkGenerator getDefaultWorldGenerator(@NotNull String worldName, String id) {
return new BukkitChunkGeneratorWrapper(generatorMap.computeIfAbsent(worldName, name -> { return new BukkitChunkGeneratorWrapper(generatorMap.computeIfAbsent(worldName, name -> {
if(!terraPlugin.getConfigRegistry().contains(id)) throw new IllegalArgumentException("No such config pack \"" + id + "\""); ConfigPack pack = terraPlugin.getConfigRegistry().get(id).orElseThrow(() -> new IllegalArgumentException("No such config pack \"" + id + "\""));
ConfigPack pack = terraPlugin.getConfigRegistry().get(id);
return pack.getGeneratorProvider().newInstance(pack); return pack.getGeneratorProvider().newInstance(pack);
}), terraPlugin.getRawConfigRegistry().get(id)); }), terraPlugin.getRawConfigRegistry().get(id).orElseThrow());
} }
} }