Remove error for duplicate world creation. Fixes #1
If a world is created using the Bukkit.createWorld API, Bukkit asks plugins multiple times to provide a world generator for the same world. So the error needs to be removed.
This commit is contained in:
parent
dbe3e2e2ca
commit
d13a853909
@ -28,11 +28,7 @@ public class WorldGeneratorApiImpl extends JavaPlugin implements WorldGeneratorA
|
||||
|
||||
@Override
|
||||
public ChunkGenerator createCustomGenerator(WorldRef world, Consumer<WorldGenerator> consumer) {
|
||||
Consumer<WorldGenerator> previous = this.worldGeneratorModifiers.putIfAbsent(world, consumer);
|
||||
if (previous != null) {
|
||||
throw new IllegalArgumentException(
|
||||
"World " + world.getName() + " was already assigned to a world generator, namely " + previous);
|
||||
}
|
||||
this.worldGeneratorModifiers.putIfAbsent(world, consumer);
|
||||
return new DummyBukkitChunkGenerator(this);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user