1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-06-26 07:02:55 +00:00

Remove tile before calling destroy

This ensures that the tile will updating neighbouring blocks, and so
the destroyed tile will not be wrapped as a peripheral.
This commit is contained in:
SquidDev 2017-09-15 17:40:53 +01:00
parent 1fdfcdb5f2
commit 60305cd106

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 ) public final void breakBlock( @Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState newState )
{ {
TileEntity tile = world.getTileEntity( pos ); TileEntity tile = world.getTileEntity( pos );
super.breakBlock( world, pos, newState );
world.removeTileEntity( pos );
if( tile != null && tile instanceof TileGeneric ) if( tile != null && tile instanceof TileGeneric )
{ {
TileGeneric generic = (TileGeneric)tile; TileGeneric generic = (TileGeneric)tile;
generic.destroy(); generic.destroy();
} }
super.breakBlock( world, pos, newState );
world.removeTileEntity( pos );
} }
@Nonnull @Nonnull