[SPIGOT-6915] ChunkPopulateEvent fires with non-new chunks Created: 30/Jan/22  Updated: 18/Jan/23

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

Type: Bug Priority: Minor
Reporter: HexedHero Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to SPIGOT-7237 Spigot not informing structure genera... Open
Version: This server is running CraftBukkit version 3417-Spigot-862678e-1eeba6a (MC: 1.18.1) (Implementing API version 1.18.1-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

ChunkPopulateEvent states that it is fired when a new chunk has been populated, due to 1.18 this isn't the case anymore and when a pre-1.18 world is upgraded the event is fired for chunks that get their y0 to y-64 blocks replaced/updated. This wouldn't be that big of an issue if it was documented and if we could tell if the chunk is new or not similar to ChunkLoadEvent#isNewChunk

A case example is you have a 1.17 world, you use the event to remove all spawners in the world when they are added, then you upgrade to 1.18 with the same event code, it'll remove all spawners in the new y0 to y-64 zone which is fine but any player placed spawners above y0 will be removed as well since you never expected the event to fire.



 Comments   
Comment by md_5 [ 30/Jan/22 ]

I don't see how this can be fixed given chunks span the whole column. Not firing the event would prevent population of new blocks below 0.

Comment by Marvin Rieple [ 30/Jan/22 ]

You should really use the (new) BlockPopulator api for this. It gives you better performance. And does not have this problem, since it prevents any modification to upgrading chunks above 0 (it only allows modification between 0 and -64 in such cases).

Generated at Tue Apr 22 05:22:31 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.