NPE crash in TileEntityMultiblockPart.isDummy
LemADEC opened this issue · 21 comments
Description of the issue:
When teleporting to a player's base, client is crashing before rendering blocks in the world.
Crashlog:
https://gist.github.com/LemADEC/2b7cccf1956f4d7838991d093e7f2344
java.lang.ArrayIndexOutOfBoundsException: 0
at blusunrize.immersiveengineering.common.blocks.TileEntityMultiblockPart.isDummy(TileEntityMultiblockPart.java:265)
at blusunrize.immersiveengineering.common.blocks.metal.TileEntityFermenter.func_73660_a(TileEntityFermenter.java:77)
at net.minecraft.world.World.func_72939_s(World.java:1832)
Versions & Modlist
FTB Continuum 1.2.1 including ImmersiveEngineering-0.12-82
- adding optifine doesn't help
- coming from north, sourth, east or west side, at ~135 m away, with render distance set to 2 chunks will reproduce the issue
- issue is reproduced in single player with the same map. In that case, I can see a blocks for a very short moment before it crashes
I'd say this is a semi-duplicate of #2973. The only way this can happen is if the TE is missing some or all of its NBT-data, and I suspect the same happened there.
Seems the issue only affects client side, since after I added the code that allows client remove the corrupted tileentity in client's world, the machine works properly.
And the issue has gone after replacing it, really weird.
I met this question too... Server side is sponge, maybe the TE is null then, why not just add a try catch to prevent client crash then we can remove the block?
Maybe I got the problem.
My server has sponge installed, and an optimization featured asynchronized light update is enabled by default, which would call Block::getLightValue
. In IE's BlockIETileProvider
class this method would cause a chunk load, which will cause an async chunk load, and this action will be caught by sponge, maybe then cause the TE corrupt.
Here's some log:
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*********************************************************************************************************************/
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* Illegal Async Chunk Load */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*********************************************************************************************************************/
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* Sponge relies on knowing when chunks are being loaded as chunks add entities to */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* the parented world for management. These operations are generally not threadsafe */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* and shouldn't be considered a "Sponge bug ". Adding/removing entities from */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* another thread to the world is never ok. */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* Chunk Pos : 45, -12 */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* java.lang.Exception: Async Chunk Load Detected */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* net.minecraft.world.chunk.Chunk.handler$startLoad$zpm000(Chunk.java:6279) */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* net.minecraft.world.chunk.Chunk.func_76631_c(Chunk.java) */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* net.minecraftforge.common.chunkio.ChunkIOProvider.syncCallback(ChunkIOProvider.java:109) */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* net.minecraftforge.common.chunkio.ChunkIOExecutor.syncChunkLoad(ChunkIOExecutor.java:94) */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:118) */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* net.minecraft.world.gen.ChunkProviderServer.func_186028_c(ChunkProviderServer.java:89) */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* net.minecraft.world.gen.ChunkProviderServer.redirect$onProvideChunkHead$zmn000(ChunkProviderServer.java:678) */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* net.minecraft.world.gen.ChunkProviderServer.func_186025_d(ChunkProviderServer.java:135) */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* net.minecraft.world.World.func_72964_e(World.java:310) */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* net.minecraft.world.World.func_175726_f(World.java:305) */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* net.minecraft.world.World.func_175625_s(World.java:6505) */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* blusunrize.immersiveengineering.common.blocks.BlockIETileProvider.getLightValue(BlockIETileProvider.java:469) */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* net.minecraft.block.state.BlockStateContainer$StateImplementation.getLightValue(BlockStateContainer.java:510) */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* org.spongepowered.common.SpongeImplHooks.getChunkPosLight(SpongeImplHooks.java:1521) */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* net.minecraft.world.WorldServer.getRawBlockLightAsync(WorldServer.java:5050) */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* net.minecraft.world.WorldServer.checkLightAsync(WorldServer.java:4874) */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* net.minecraft.world.WorldServer.lambda$updateLightAsync$0(WorldServer.java:4990) */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* net.minecraft.world.WorldServer$$Lambda$3126.00000000204E40F0.run(Unknown Source) */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* java.lang.Thread.run(Thread.java:819) */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*********************************************************************************************************************/
That looks like it's the same problem as SpongePowered/SpongeForge#2857, and I agree with the EIO dev(s), this is a Sponge bug, despite the log message.
Tested on forge server players also crashed with this error
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at blusunrize.immersiveengineering.common.blocks.TileEntityMultiblockPart.isDummy(TileEntityMultiblockPart.java:284) ~[TileEntityMultiblockPart.class:?]
at blusunrize.immersiveengineering.common.blocks.metal.TileEntityArcFurnace.update(TileEntityArcFurnace.java:75) ~[TileEntityArcFurnace.class:?]
at net.minecraft.world.World.redirect$tileEntityUpdate$zbc000(World.java:4132) ~[amu.class:?]
at net.minecraft.world.World.updateEntities(World.java:1835) ~[amu.class:?]
For a quick fix you can use setblock command to delete corrupted blocks, and disable Async Light Optimization in sponge's configuration (global.conf
).