From 60305cd10653f618f971c5876fbf1c0caf1666f7 Mon Sep 17 00:00:00 2001 From: SquidDev Date: Fri, 15 Sep 2017 17:40:53 +0100 Subject: [PATCH] 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. --- .../java/dan200/computercraft/shared/common/BlockGeneric.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/dan200/computercraft/shared/common/BlockGeneric.java b/src/main/java/dan200/computercraft/shared/common/BlockGeneric.java index cf65d541b..589548f61 100644 --- a/src/main/java/dan200/computercraft/shared/common/BlockGeneric.java +++ b/src/main/java/dan200/computercraft/shared/common/BlockGeneric.java @@ -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