Esempio n. 1
0
 public void forEachTileInChunk(int cx, int cz, RunnableVal2<Vector, BaseBlock> onEach) {
   int bx = cx << 4;
   int bz = cz << 4;
   Vector mutable = new Vector(0, 0, 0);
   for (int x = 0; x < 16; x++) {
     int xx = x + bx;
     for (int z = 0; z < 16; z++) {
       int zz = z + bz;
       for (int y = 0; y < getMaxY(); y++) {
         int combined = getCombinedId4Data(xx, y, zz);
         if (combined == 0) {
           continue;
         }
         int id = FaweCache.getId(combined);
         if (FaweCache.hasNBT(id)) {
           mutable.x = xx;
           mutable.z = zz;
           mutable.y = y;
           CompoundTag tile = getTileEntity(x, y, z);
           BaseBlock block = new BaseBlock(id, FaweCache.getData(combined), tile);
           onEach.run(mutable, block);
         }
       }
     }
   }
 }