
[Bug]: [1.12.2] NullPointerException - `OTGChunkGenerator.chunkbuffer` is `null` if a Woodland Mansion is placed during `recreateStructures`
TigerWalts opened this issue ยท 0 comments
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
A player joining the server is triggering the load of a chunk.
The recreateStructures
stage of the chunkload determines that an OTG Woodland Mansion needs to be placed.
The server then crashes when the OTG Woodland Mansion generator tries to find the height of the highest block at the centre of a chunk.
The method (getHighestBlockInCurrentlyPopulatingChunk
) that performs this relies on the OTGChunkGenerator.chunkbuffer
being populated but I believe that this only happens during chunk generation and it is set to null during a replaceStructures
stage.
Expected Behavior
No crash during replaceStructures
when a Woodland Mansion needs to be placed.
Which platforms have you reproduced this issue using?
Forge Multiplayer / Forge Singleplayer
OTG Version
OTG 1.12.2-v9.5-R2 (RAD 1.55)
Platform Version
forge-14.23.5.2860
Steps To Reproduce
I'm not sure what circumstances can leave a world in this state but here's a way to reproduce:
- Create a new singleplayer world with cheats enabled
- Go to creative mode and fly
- Use the command
/locate Mansion
to get the x, z block co-ordinates - Teleport to the that location, wait for the generation to complete
- Save and exit to the menu
- In the world save find the file
<world>/data/Mansion.dat
- Either:
- Delete/rename this file
or - Edit the file in an NBT editor and remove all the child nudes under
Features
- Delete/rename this file
- Open the world in the game
Log file
Singleplayer Crash:
Log: https://paste.denizenscript.com/View/135845
Crash Report: https://mclo.gs/ZRwKYjd
Multiplayer Crash:
Log Partial: https://paste.denizenscript.com/View/135839
[16:10:47] [Server thread/ERROR] [net.minecraft.server.MinecraftServer]: Encountered an unexpected exception
net.minecraft.util.ReportedException: Exception preparing structure feature
at net.minecraft.world.gen.structure.MapGenStructure.recursiveGenerate(MapGenStructure.java:75) ~[bbu.class:?]
at com.pg85.otg.forge.generator.structure.OTGMapGenStructure.generate(OTGMapGenStructure.java:34) ~[OTGMapGenStructure.class:?]
at com.pg85.otg.forge.world.ForgeWorld.recreateStructures(ForgeWorld.java:1021) ~[ForgeWorld.class:?]
...
Caused by: java.lang.NullPointerException
at com.pg85.otg.forge.generator.OTGChunkGenerator.getHighestBlockInCurrentlyPopulatingChunk(OTGChunkGenerator.java:501) ~[OTGChunkGenerator.class:?]
at com.pg85.otg.forge.generator.structure.OTGWoodLandMansionStart.create(OTGWoodLandMansionStart.java:57) ~[OTGWoodLandMansionStart.class:?]
at com.pg85.otg.forge.generator.structure.OTGWoodLandMansionStart.<init>(OTGWoodLandMansionStart.java:31) ~[OTGWoodLandMansionStart.class:?]
Crash Report: https://mclo.gs/5gWu8Hc
Anything else?
This bug was previously reported: #267
The fix applied may have solved a different bug.