Chicken-Bones / ChickenChunks

MIT License
27 stars 24 forks source link

Bugfix for NPE on dimension load with other chunkloaders #36

Open CraigParton opened 9 years ago

CraigParton commented 9 years ago

Fixes Issues

The getPlayerOrganiser method references the playerOrganisers hashmap without checking to see if it is null. It will be null if the activate() method of TileChunkLoader base is called by another chunkloading mod before the chunk manager is loaded. A simple null check won't work in this case, so I check the loaded flag and, if false, call the load() method to initialize the chunk manager before referencing the HashMap.

My server was crashing while loading the deep dark dimension. One of my players had placed an Extra Utilities Ender Quarry there with a ChickenChunk loader next to it. Why, I don't know, because the Ender Quarry has a chunkloader already. Anyway, next time I restarted the server crashed with this stack trace. After patching and updating the plugin it started just fine with no issues.

java.lang.NullPointerException: Exception getting block type in world at codechicken.chunkloader.ChunkLoaderManager.getPlayerOrganiser(ChunkLoaderManager.java:659) at codechicken.chunkloader.ChunkLoaderManager.getOrganiser(ChunkLoaderManager.java:638) at codechicken.chunkloader.ChunkLoaderManager.addChunkLoader(ChunkLoaderManager.java:629) at codechicken.chunkloader.TileChunkLoaderBase.activate(TileChunkLoaderBase.java:108) at codechicken.chunkloader.TileChunkLoader.activate(TileChunkLoader.java:114) at codechicken.chunkloader.TileChunkLoaderBase.func_145829_t(TileChunkLoaderBase.java:35) at net.minecraft.world.chunk.Chunk.func_150812_a(Chunk.java:975) ...

HeberonYT commented 8 years ago

Has this been solved? I have the same problem, a crasheo endless. I do not want to deactivate your mod, please help!