Only rename the dropped item if the TE is nameable. Fixes #5455

This commit is contained in:
pupnewfster committed 2019-05-03 14:09:22 -04:00
1 parent 20c426d03e
commit da012bcf7d
1 file changed
+5 -2
@@ -48,8 +48,11 @@ public abstract class BlockMekanismContainer extends BlockContainer {
}
player.addExhaustion(0.005F);
if (!world.isRemote) {
Block.spawnAsEntity(world, pos,
getDropItem(state, world, pos).setStackDisplayName(((IWorldNameable) te).getName()));
ItemStack dropItem = getDropItem(state, world, pos);
if (te instanceof IWorldNameable) {
dropItem.setStackDisplayName(((IWorldNameable) te).getName());
}
Block.spawnAsEntity(world, pos, dropItem);
}
//Set it to air like the flower pot's harvestBlock method
world.setBlockToAir(pos);