Example #1
0
 public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
   DMPedestalTile tile = ((DMPedestalTile) world.getTileEntity(x, y, z));
   if (tile.getItemStack() != null) {
     WorldHelper.spawnEntityItem(world, tile.getItemStack().copy(), x, y, z);
   }
   tile.invalidate();
   super.breakBlock(world, x, y, z, block, meta);
 }
Example #2
0
  @Override
  public void breakBlock(World world, int x, int y, int z, int par5, int par6) {
    TileEntityLimekiln tileEntity = (TileEntityLimekiln) world.getBlockTileEntity(x, y, z);

    if (tileEntity != null) tileEntity.invalidateMultiblock();

    dropItems(world, x, y, z);
    super.breakBlock(world, x, y, z, par5, par6);
  }
 @Override
 public void breakBlock(World world, BlockPos pos, IBlockState state) {
   TileEntity tileEntity = world.getTileEntity(pos);
   if (tileEntity instanceof IInventory) {
     IInventory inv = (IInventory) tileEntity;
     InventoryHelper.dropInventoryItems(world, pos, inv);
   }
   if (tileEntity instanceof ISimpleInventory) {
     ISimpleInventory inv = (ISimpleInventory) tileEntity;
     InventoryUtil.dropInventoryItems(world, pos, inv);
   }
   super.breakBlock(world, pos, state);
 }
 @Override
 public void breakBlock(World world, int x, int y, int z, int par5, int par6) {
   if (!world.isRemote && world.getGameRules().getGameRuleBooleanValue("doTileDrops")) {
     TileEntity te = world.getBlockTileEntity(x, y, z);
     if (!(te instanceof TileCapacitorBank)) {
       super.breakBlock(world, x, y, z, par5, par6);
       return;
     }
     TileCapacitorBank cb = (TileCapacitorBank) te;
     Util.dropItems(world, cb, x, y, z, true);
   }
   world.removeBlockTileEntity(x, y, z);
 }
  @Override
  public void breakBlock(World world, int i, int j, int k, Block block, int l) {
    super.breakBlock(world, i, j, k, block, l);

    if (!world.isRemote) {
      world.notifyBlocksOfNeighborChange(i, j + 1, k, this);
      world.notifyBlocksOfNeighborChange(i, j - 1, k, this);
      world.notifyBlocksOfNeighborChange(i + 1, j, k, this);
      world.notifyBlocksOfNeighborChange(i - 1, j, k, this);
      world.notifyBlocksOfNeighborChange(i, j, k + 1, this);
      world.notifyBlocksOfNeighborChange(i, j, k - 1, this);
      this.updateAndPropagateCurrentStrength(world, i, j, k);
      this.notifyWireNeighborsOfNeighborChange(world, i - 1, j, k);
      this.notifyWireNeighborsOfNeighborChange(world, i + 1, j, k);
      this.notifyWireNeighborsOfNeighborChange(world, i, j, k - 1);
      this.notifyWireNeighborsOfNeighborChange(world, i, j, k + 1);
      this.notifyWireNeighborsOfNeighborChange(world, i, j - 1, k);
      this.notifyWireNeighborsOfNeighborChange(world, i, j + 1, k);
    }
  }
 @Override
 public void breakBlock(World world, int x, int y, int z, int par5, int par6) {
   dropItems(world, x, y, z);
   super.breakBlock(world, x, y, z, par5, par6);
 }
Example #7
0
 @Override
 public void breakBlock(World world, BlockPos pos, IBlockState state) {
   dropItems(world, pos);
   super.breakBlock(world, pos, state);
 }
Example #8
0
 @Override
 public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
   dropInventory(world, x, y, z);
   super.breakBlock(world, x, y, z, block, 0);
 }
 // When the block is broken, you may need to notify neighbours.
 @Override
 public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
   worldIn.notifyNeighborsOfStateChange(pos, this);
   super.breakBlock(worldIn, pos, state);
 }