@Override
  public void onNeighborBlockChange(World world, int x, int y, int z, Block blockId) {
    super.onNeighborBlockChange(world, x, y, z, blockId);
    if (updateEveryone) {
      TileEntityLittleChunk tile = (TileEntityLittleChunk) world.getTileEntity(x, y, z);
      if (tile != null) {
        int maX = tile.size, maY = tile.size, maZ = tile.size;
        int startX = 0, startY = 0, startZ = 0;
        for (int side = 0; side < 6; side++) {
          switch (side) {
            case 0:
              maY = 1;
              break;

            case 1:
              startY = maY - 1;
              break;

            case 2:
              maZ = 1;
              break;

            case 3:
              startZ = maZ - 1;
              break;

            case 4:
              maX = 1;
              break;

            case 5:
              startX = maX - 1;
              break;
          }

          for (int xx = startX; xx < maX; xx++) {
            for (int yy = startY; yy < maY; yy++) {
              for (int zz = startZ; zz < maZ; zz++) {
                if (tile.getBlock(xx, yy, zz) != Blocks.air) {
                  Block littleBlock = tile.getBlock(xx, yy, zz);
                  if (littleBlock != null) {
                    littleBlock.onNeighborBlockChange(
                        (World) tile.getLittleWorld(),
                        (x << 3) + xx,
                        (y << 3) + yy,
                        (z << 3) + zz,
                        blockId);
                  }
                }
              }
            }
          }
        }
      } else {
        super.onNeighborBlockChange(world, x, y, z, blockId);
      }
    }
  }
Exemple #2
0
  public void onNeighborBlockChange(World world, int x, int y, int z, int neighbor) {
    if (!canBeHere(world, x, y, z)) {
      world.setBlock(x, y, z, 0);
    }

    super.onNeighborBlockChange(world, x, y, z, neighbor);
  }
  /**
   * 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 Block
   */
  public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
    super.onNeighborBlockChange(world, x, y, z, block);
    TileEntityBlueMateriaChest TileEntityBlueMateriaChest =
        (TileEntityBlueMateriaChest) world.getTileEntity(x, y, z);

    if (TileEntityBlueMateriaChest != null) {
      TileEntityBlueMateriaChest.updateContainingBlockInfo();
    }
  }
  @Override
  public void onNeighborBlockChange(World world, int x, int y, int z, int neighborBlockID) {
    super.onNeighborBlockChange(world, x, y, z, neighborBlockID);

    TileEntity te = world.getBlockTileEntity(x, y, z);
    if (te instanceof TileEntityReactorRedstonePort) {
      ((TileEntityReactorRedstonePort) te).onNeighborBlockChange(x, y, z, neighborBlockID);
    }
  }
  /**
   * 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();
    }
  }
  @Override
  public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5) {
    super.onNeighborBlockChange(par1World, par2, par3, par4, par5);
    final TileEntityT10TreasureChest var6 =
        (TileEntityT10TreasureChest) par1World.getTileEntity(par2, par3, par4);

    if (var6 != null) {
      var6.updateContainingBlockInfo();
    }
  }
  /* Wrappers ************************************************************ */
  @Override
  public void onNeighborBlockChange(World world, int x, int y, int z, int id) {
    super.onNeighborBlockChange(world, x, y, z, id);

    Pipe pipe = getPipe(world, x, y, z);

    if (isValid(pipe)) {
      pipe.container.scheduleNeighborChange();
    }
  }