[SPIGOT-2574] Random multiple instances of BlockPopulators Created: 05/Aug/16  Updated: 06/Aug/16  Resolved: 06/Aug/16

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

Type: Bug Priority: Major
Reporter: Gregory L Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: generation, generator, world
Environment:

Mac OS X 10.11.6, Java 1.8.0_73, Worlds Managed with Multiverse 2.5 (Multiverse-Core 1.1)


Attachments: File SpigotBug.jar    
Issue Links:
Duplicate
is duplicated by SPIGOT-2575 Custom populators are added twice whe... Resolved
Plugin: SpigotBug

 Description   

It seems that BlockPopulators can randomly be added more than once to a World, causing them to run more than once per chunk. I have included a sample plugin demonstrating the bug (contains source).

The console output will contain listings of currently loaded BlockPopulators in the generated world. At first, there will be only one instance. But towards the end, one can notice that there are two listed.

Upon investigation, I found two points at which the generators are added to the world:

in World.b():

if (this.generator != null) {
	getWorld().getPopulators().addAll(this.generator.getDefaultPopulators(getWorld()));
}

As well as in CraftServer.createWorld(WorldCreator), with the same conditions:

if (generator != null) {
	internal.getWorld().getPopulators().addAll(generator.getDefaultPopulators(internal.getWorld()));
}

What is worth noting, is that CraftServer.createWorld(WorldCreator) actually calls World.b() a couple of lines before.

I believe this is what causes the bug, though I have not actually tried solving it since I'm unfamiliar with the internal codebase.



 Comments   
Comment by Bartosz Skrzypczak [ 05/Aug/16 ]

Uh... I reported the same bug 2.5 hours later. Why searching didn't find it? https://hub.spigotmc.org/jira/browse/SPIGOT-2575

Generated at Thu Mar 27 04:31:24 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.