1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-13 19:50:31 +00:00

Merge pull request #453 from SquidDev-CC/ComputerCraft/hotfix/eager-remove-te

Remove tile before calling destroy
This commit is contained in:
SquidDev 2017-11-14 21:15:47 +00:00
commit f8487d1e1c

View File

@ -111,13 +111,13 @@ public abstract class BlockGeneric extends Block implements
public final void breakBlock( @Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState newState )
{
TileEntity tile = world.getTileEntity( pos );
super.breakBlock( world, pos, newState );
world.removeTileEntity( pos );
if( tile != null && tile instanceof TileGeneric )
{
TileGeneric generic = (TileGeneric)tile;
generic.destroy();
}
super.breakBlock( world, pos, newState );
world.removeTileEntity( pos );
}
@Nonnull