示例#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);
         }
       }
     }
   }
 }
 @Override
 public boolean test(Vector vector) {
   if (combined != -1) {
     return FaweCache.getCombined(extent.getLazyBlock(vector)) == combined;
   } else {
     combined = FaweCache.getCombined(extent.getLazyBlock(vector));
     return true;
   }
 }
示例#3
0
 public int getOpacity(int x, int y, int z) {
   int combined = getCombinedId4Data(x, y, z);
   if (combined == 0) {
     return 0;
   }
   BlockMaterial block = BundledBlockData.getInstance().getMaterialById(FaweCache.getId(combined));
   if (block == null) {
     return 255;
   }
   return block.getLightOpacity();
 }