Beispiel #1
0
 public TileEntity getChunkBlockTileEntity(int i, int j, int k) {
   ChunkPosition chunkposition = new ChunkPosition(i, j, k);
   TileEntity tileentity = (TileEntity) chunkTileEntityMap.get(chunkposition);
   if (tileentity == null) {
     int l = getBlockID(i, j, k);
     if (!Block.isBlockContainer[l]) {
       return null;
     }
     BlockContainer blockcontainer = (BlockContainer) Block.blocksList[l];
     blockcontainer.onBlockAdded(worldObj, xPosition * 16 + i, j, zPosition * 16 + k);
     tileentity = (TileEntity) chunkTileEntityMap.get(chunkposition);
   }
   if (tileentity != null && tileentity.func_31006_g()) {
     chunkTileEntityMap.remove(chunkposition);
     return null;
   } else {
     return tileentity;
   }
 }
Beispiel #2
0
 public TileEntity func_1002_d(int i, int j, int k) {
   ChunkPosition chunkposition = new ChunkPosition(i, j, k);
   TileEntity tileentity = (TileEntity) field_1529_l.get(chunkposition);
   if (tileentity == null) {
     int l = func_1008_a(i, j, k);
     if (!Block.field_342_q[l]) {
       return null;
     }
     if (tileentity == null) {
       tileentity = ((BlockContainer) Block.field_345_n[l]).func_283_a_();
       field_1537_d.func_654_a(field_1531_j * 16 + i, j, field_1530_k * 16 + k, tileentity);
     }
     tileentity = (TileEntity) field_1529_l.get(chunkposition);
   }
   if (tileentity != null && tileentity.func_31006_g()) {
     field_1529_l.remove(chunkposition);
     return null;
   } else {
     return tileentity;
   }
 }