[SPIGOT-2575] Custom populators are added twice when creating world using WorldCreator/Bukkit.createWorld Created: 05/Aug/16  Updated: 05/Aug/16  Resolved: 05/Aug/16

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Bartosz Skrzypczak Assignee: Unassigned
Resolution: Duplicate Votes: 1
Labels: Craftbukkit, generator, world

Issue Links:
Duplicate
duplicates SPIGOT-2574 Random multiple instances of BlockPop... Resolved

 Description   

This is issue causes this issue in my plugin: https://github.com/Barteks2x/173generator/issues/10. It happens only when using multi-world plugin (multiverse in this case, but it doesn't really matter).

The bug in my plugin is that snow layer is generated twice. The reason is that my populator is always called twice, even if I return only one populator from ChunkGenerator.getDefaultPopulators.

The reason in code:
CraftServer.createWorld(...) first creates new WorldServer, and calls method b(). b() has craftbukkit patch to add all populators from custom generator.

Then CraftServer.createWorld(...) adds all populators again, which results in all populators being added twice.

For most generators it doesn't cause any visible issues because they are pseudo-random but deterministic. Positions of generated structures and resources are always the same, so the second time they are simply overwritten. But it does make generation much slower and may cause duplication bugs (like in my plugin).


Generated at Sun Mar 30 17:54:39 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.