Ancient Warfare 2

Ancient Warfare 2

6M Downloads

Structure System -- Superflat worlds with templates with pistons can crash on initial world gen

shadowmage45 opened this issue ยท 4 comments

commented

Caused by: java.lang.NullPointerException
at net.minecraft.world.WorldServer.addBlockEvent(WorldServer.java:1001)
at net.minecraft.block.BlockPistonBase.updatePistonState(BlockPistonBase.java:169)
at net.minecraft.block.BlockPistonBase.onBlockAdded(BlockPistonBase.java:143)
at net.minecraft.world.chunk.Chunk.func_150807_a(Chunk.java:713)
at net.minecraft.world.World.setBlock(World.java:519)

Having researched this extensively before -- this is a vanilla issue, caused by the world generation commencing before the block-event lists have been initialized in the world. Does not occur on every world generation, but if a world gets bugged, it will never load.

There is no 'proper' solution that I can implement.

-A- solution that I might be able to use is to delay generation of structures by at least a single tick. This would require a tick handler with a queue of chunks to generate, deferring the calls from the world-generator to this tick handler.
-Might- be worth investigating for other performance reasons, and this would likely also additionally solve issues of minecraft decorators overwriting structures @ world-gen time. Could also help reduce issues of recursive chunk-generation.

commented

So turn structure-gen off for this error to go away?

commented

The solution roughly explained above has been implemented a long time ago.
Updating should solve the error.
If it still happen, please upload the world save.

commented

Hi. It was a new mod rf quarry causing world Gen issues with no debug info to link the problem to it. Sorry for bumping this

commented

Closing as an old issue that doesn't affect latest versions.