Closed romsto closed 4 years ago
I saw this too with the latest versions of WorldGeneratorAPI and PaperMC.
I haven't tried with Spigot yet. Going to check with the Paper community and maybe PR.
I'm having this issue as well. Did you fix it for yourself?
Having this issue as well. It happens only when a plugin uses WorldGeneratorApi through the WorldGeneratorInitEvent, and no plugin on the server is using WorldGeneratorApi through the getDefaultWorldGenerator
method.
If the getDefaultWorldGenerator
method is not used, WorldGeneratorApi is activated through Bukkit's WorldInitEvent
method. It seems that this method is now called after the first few chunks have been generated. I will need to find some workaround...
Happens on Spigot too... I'll try to see if I can come up with something in the Bukkit API that breaks because the WorldInitEvent is fired too late. If yes, then I can submit a valid bug report to them.
This is going to be very hard to get fixed. Basically, the WorldInitEvent is fired after the first chunks start loading, but before the first chunks finish loading.
This problem does not happen when using Spigot's world generator api. This is because BlockPopulators work on fully loaded chunks. Here's an example that does work correctly:
@EventHandler
public void onWorldInit(WorldInitEvent event) {
event.getWorld().getPopulators().add(new BlockPopulator() {
@Override
public void populate(World world, Random random, Chunk chunk) {
getLogger().info("Generating for chunk " + chunk);
for (int x = 1; x < 15; x++) {
for (int z = 1; z < 15; z++) {
chunk.getBlock(x, 100, z).setType(Material.RED_STAINED_GLASS);
}
}
}
});
}
A Spigot bug report exists: SPIGOT-5569, but because it's a rather theoretical issue when only using the Bukkit API, and it will cause other issues when fixed, there isn't really an interest to fix it.
So I need to find another place to call the WorldGeneratorInitEvent from. Suggestions are welcome.
Should be fixed in build 12 at https://ci.codemc.io/job/rutgerkok/job/WorldGeneratorApi/ . WorldGeneratorApi now injects itself into the CraftServer.worlds map, so that it can catch early-on when a new world is loaded.
Description While editing the BiomeGenerator in the WorldGeneratorInitEvent, the generated world contains few chunks not edited arround the spawn.
X X X X X X X X X X X X S X X X X X X X X X X X X
X represents not edited chunks (I set another biome to spawn but this biome still spawns, also works when you remove all decorations: in these chunks the decorations isn't remove) S represents the Spawn chunk (not edited too)
To Reproduce Steps to reproduce the behavior:
Screenshots
https://prnt.sc/tfwnlj https://prnt.sc/tfwpyt https://prnt.sc/tfwn1g in red the not edited generated chunks, and blue the well generated chunks