Fix crash when teleposing Demon Will Crystals (#1062)
(cherry picked from commit 970acd4
)
This commit is contained in:
parent
88efd672d5
commit
72bf53f8d3
|
@ -158,12 +158,16 @@ public class BlockDemonCrystal extends Block
|
|||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state)
|
||||
{
|
||||
TileDemonCrystal tile = (TileDemonCrystal) world.getTileEntity(pos);
|
||||
EnumDemonWillType type = state.getValue(TYPE);
|
||||
int number = tile.getCrystalCount();
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if (tile instanceof TileDemonCrystal) {
|
||||
EnumDemonWillType type = state.getValue(TYPE);
|
||||
int number = ((TileDemonCrystal) tile).getCrystalCount();
|
||||
|
||||
spawnAsEntity(world, pos, getItemStackDropped(type, number));
|
||||
world.removeTileEntity(pos);
|
||||
spawnAsEntity(world, pos, getItemStackDropped(type, number));
|
||||
world.removeTileEntity(pos);
|
||||
}
|
||||
|
||||
super.breakBlock(world, pos, state);
|
||||
}
|
||||
|
||||
public static ItemStack getItemStackDropped(EnumDemonWillType type, int crystalNumber)
|
||||
|
|
Loading…
Reference in a new issue