Skip to content
Permalink
Browse files

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.
  • Loading branch information...
SquidDev committed Sep 15, 2017
1 parent 1fdfcdb commit 60305cd10653f618f971c5876fbf1c0caf1666f7
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/main/java/dan200/computercraft/shared/common/BlockGeneric.java
@@ -111,13 +111,13 @@ public final void dropItem( World world, BlockPos pos, @Nonnull ItemStack stack
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

0 comments on commit 60305cd

Please sign in to comment.
You can’t perform that action at this time.