示例#1
0
 public void setNewChunkBlockTileEntity(int i, int j, int k, TileEntity tileentity) {
   ChunkPosition chunkposition = new ChunkPosition(i, j, k);
   tileentity.worldObj = worldObj;
   tileentity.xCoord = xPosition * 16 + i;
   tileentity.yCoord = j;
   tileentity.zCoord = zPosition * 16 + k;
   newChunkTileEntityMap.put(chunkposition, tileentity);
 }
示例#2
0
 public void setChunkBlockTileEntity(int i, int j, int k, TileEntity tileentity) {
   ChunkPosition chunkposition = new ChunkPosition(i, j, k);
   tileentity.worldObj = worldObj;
   tileentity.xCoord = xPosition * 16 + i;
   tileentity.yCoord = j;
   tileentity.zCoord = zPosition * 16 + k;
   if (getBlockID(i, j, k) == 0
       || !(Block.blocksList[getBlockID(i, j, k)] instanceof BlockContainer)) {
     System.out.println("Attempted to place a tile entity where there was no entity tile!");
     return;
   } else {
     tileentity.func_31004_j();
     chunkTileEntityMap.put(chunkposition, tileentity);
     return;
   }
 }
示例#3
0
  /** Sets the TileEntity for a given block in this chunk */
  public void setChunkBlockTileEntity(int par1, int par2, int par3, TileEntity par4TileEntity) {
    ChunkPosition var5 = new ChunkPosition(par1, par2, par3);
    par4TileEntity.setWorldObj(this.worldObj);
    par4TileEntity.xCoord = this.xPosition * 16 + par1;
    par4TileEntity.yCoord = par2;
    par4TileEntity.zCoord = this.zPosition * 16 + par3;

    if (this.getBlockID(par1, par2, par3) != 0
        && Block.blocksList[this.getBlockID(par1, par2, par3)] instanceof ITileEntityProvider) {
      if (this.chunkTileEntityMap.containsKey(var5)) {
        ((TileEntity) this.chunkTileEntityMap.get(var5)).invalidate();
      }

      par4TileEntity.validate();
      this.chunkTileEntityMap.put(var5, par4TileEntity);
    }
  }