Ejemplo n.º 1
0
  /** Set the metadata of a block in the chunk */
  public boolean setBlockMetadata(int par1, int par2, int par3, int par4) {
    ExtendedBlockStorage var5 = this.storageArrays[par2 >> 4];

    if (var5 == null) {
      return false;
    } else {
      int var6 = var5.getExtBlockMetadata(par1, par2 & 15, par3);

      if (var6 == par4) {
        return false;
      } else {
        this.isModified = true;
        var5.setExtBlockMetadata(par1, par2 & 15, par3, par4);
        int var7 = var5.getExtBlockID(par1, par2 & 15, par3);

        if (var7 > 0 && Block.blocksList[var7] instanceof ITileEntityProvider) {
          TileEntity var8 = this.getChunkBlockTileEntity(par1, par2, par3);

          if (var8 != null) {
            var8.updateContainingBlockInfo();
            var8.blockMetadata = par4;
          }
        }

        return true;
      }
    }
  }
Ejemplo n.º 2
0
 /** Return the metadata corresponding to the given coordinates inside a chunk. */
 public int getBlockMetadata(int par1, int par2, int par3) {
   if (par2 >> 4 >= this.storageArrays.length) {
     return 0;
   } else {
     ExtendedBlockStorage var4 = this.storageArrays[par2 >> 4];
     return var4 != null ? var4.getExtBlockMetadata(par1, par2 & 15, par3) : 0;
   }
 }