TerraFirmaCraft

TerraFirmaCraft

2M Downloads

Barrel crash

Mrthomas20121 opened this issue ยท 5 comments

commented

Describe the bug
Picking up barrel crash the game

To Reproduce

  • you put a barrel in the world
  • you add a copy to your hand with ctrl and the standard creative block picking method(usually mouse wheel).
  • open your inventory
  • get the cursor on the barrel you added to your hand
  • it crash

Meta Info

commented

Can you reproduce this with Forge build 2678? Could you please give a screenshot of the barrel right before the game crashes?

commented

I can't reproduce this.

commented

it basically crash when you pick the barrel that is filled with something.

commented

Problem is this line:

ItemStackHandler stackHandler = new ItemStackHandler();

assumes a inventory of size 1, which will crash when generating the tooltip.

Edit: deserializeNBT() calls to resize the stack handler, so this shouldn't be the problem. Potentially a broken item instance missing the Size property? Otherwise I can't reproduce.

commented

BlockBarrel needs to override getPickBlock and return a stack with the appropriate NBT tag for the sealed barrel (if it is sealed) and the unsealed one if not. Minecraft tries to be helpful and append the tile entity data in the BlockEntityTag section