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:
commit
f8487d1e1c
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user