/** * Called on server worlds only when the block has been replaced by a different block ID, or the * same block with a different metadata value, but before the new metadata value is set. Args: * World, x, y, z, old block ID, old metadata */ public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { TileEntityBoundChest tileentitychest = (TileEntityBoundChest) par1World.getTileEntity(par2, par3, par4); if (tileentitychest != null) { this.dropItem( new ItemStack( ThaumicExploration.blankSeal, 1, 15 - ((TileEntityBoundChest) par1World.getTileEntity(par2, par3, par4)) .getSealColor()), par1World, par2, par3, par4); for (int j1 = 0; j1 < tileentitychest.getSizeInventory(); ++j1) { ItemStack itemstack = tileentitychest.getStackInSlot(j1); this.dropItem(itemstack, par1World, par2, par3, par4); } par1World.func_147453_f(par2, par3, par4, par5); } super.breakBlock(par1World, par2, par3, par4, par5, par6); }
/** * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed * (coordinates passed are their own) Args: x, y, z, neighbor blockID */ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5) { super.onNeighborBlockChange(par1World, par2, par3, par4, par5); TileEntityBoundChest tileentitychest = (TileEntityBoundChest) par1World.getTileEntity(par2, par3, par4); if (tileentitychest != null) { tileentitychest.updateContainingBlockInfo(); } }