[SPIGOT-6348] World#isChunkGenerated false positives Created: 07/Feb/21 Updated: 08/Feb/21 |
|
Status: | Open |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | Azim | Assignee: | Unassigned |
Resolution: | Unresolved | Votes: | 0 |
Labels: | 1.16.4, bug, world |
Attachments: |
![]() ![]() |
Version: | git-Spigot-a93cbb1-7a6c3c9 (1.16.4-R0.1-SNAPSHOT) |
Guidelines Read: | Yes |
Description |
code, where i check if chunk exists |
Comments |
Comment by Azim [ 08/Feb/21 ] |
Paper has a neat solution for that: works exactly as my usecase needs it, so i guess i'm tightening my plugin's userbase to paper now |
Comment by blablubbabc [ 08/Feb/21 ] |
> Then why is it called isChunkGenerated instead of isChunkExist or something? Figuring out these differences between version to version and trying to match the old API to the new Minecraft behavior is difficult, especially for this chunk loading related code. And since no one proposed a suitable solution yet (i.e. noone had the motivation or urgent enough need to look through the underlying Minecraft code on this and propose a suitable solution), this was never changed and instead kept as it is right now. > Effectively it means i'll have to use nms or check all chunks in 2-chunk radius to get what i want from it? |
Comment by Azim [ 08/Feb/21 ] |
Then why is it called isChunkGenerated instead of isChunkExist or something? |
Comment by blablubbabc [ 08/Feb/21 ] |
Maybe related: https://hub.spigotmc.org/jira/browse/SPIGOT-4862 You also have to check the 2 surrounding chunks if they are also already generated. Minecraft will also trigger their generation whenever you load a single chunk. Edit: And the other problematic thing that might affect you, also mentioned in that other ticket, and which might explain why you get the populate event for that chunk after you have checked if it has been generated, is that isChunkGenerated might currently only check if the chunk already 'exists', i.e. if the generation of the chunk has been started, not whether it has already been fully generated (there are different chunk generation stages in Minecraft; loading the chunk will promote it to 'fully generated' which then triggers the remaining chunk generation stages, including block population). |