EvilCraft

EvilCraft

19M Downloads

NullPointerException rendering blood stained block in inventory

CplPibald opened this issue ยท 5 comments

commented

Issue type:

  • ๐Ÿ› Bug

A player on my server got an evilcraft:blood_stained_block in his inventory, which caused a client crash every time that he opened his inventory. I believe the invalid item was added to the inventory by the Corail Tombstone mod, but EvilCraft probably shouldn't be crashing even if this happens.

java.lang.NullPointerException: Rendering item
    at org.cyclops.evilcraft.client.render.model.ModelBloodStainedBlock.getGeneralQuads(ModelBloodStainedBlock.java:50)
    at org.cyclops.cyclopscore.client.model.DynamicItemAndBlockModel.func_188616_a(DynamicItemAndBlockModel.java:50)
    at org.cyclops.cyclopscore.client.model.DynamicItemAndBlockModel.func_188616_a(DynamicItemAndBlockModel.java:48)
    at net.minecraft.client.renderer.RenderItem.func_191967_a(RenderItem.java:122)

Full crash report

The complete NBT for the invalid itemstack is {id: "evilcraft:blood_stained_block"; Count: 1; Damage: 0}

The problem started after the player died while fighting an enderman. My best guess is an enderman picked up a blood stained block and dropped it right when the player died, resulting in that block getting sucked into the tomb with the rest of the items.

commented

Must be because of a recent change: f02c9e1

@josephcsible Could you look into this one? I guess changing the scope of the try-catch should be sufficient.

commented

This happened on 0.10.53, and it looks like a duplicate of #680, which is already fixed in 0.10.54.

commented

@josephcsible Are you sure? The stacktrace seems to indicate that either innerBlockState or innerBlockState.getBlock() is null (which was being caught before), as the crash happens inside of ModelBloodStainedBlock#getGeneralQuads.

commented

Oh, you may be right.

commented

That definitely makes it not crash, but I'm still somewhat concerned how a blood-stained block ended up without its NBT.