Exemple #1
0
  @Override
  public void onNeighborBlockChange(World world, int x, int y, int z, int blockID) {
    super.onNeighborBlockChange(world, x, y, z, blockID);

    TileEntity tileEntity = world.getBlockTileEntity(x, y, z);

    if (tileEntity instanceof IConductor) {
      world.markBlockForUpdate(x, y, z);
    }
  }
Exemple #2
0
  @Override
  public void breakBlock(World world, int x, int y, int z, int par5, int par6) {
    TileEntity tile = world.getBlockTileEntity(x, y, z);

    if (tile instanceof TileEntityWire) {
      TileEntityWire tileEntity = (TileEntityWire) tile;

      if (tileEntity.isInsulated) {
        dropBlockAsItem_do(
            world,
            x,
            y,
            z,
            new ItemStack(Block.cloth, 1, BlockColored.getBlockFromDye(tileEntity.dyeID)));
      }
    }

    super.breakBlock(world, x, y, z, par5, par6);
  }