示例#1
0
 @Override
 public void sphericalFill(boolean ignoreAir) {
   final float xScale = max.getX() - min.getX() + 1;
   final float yScale = max.getY() - min.getY() + 1;
   final float zScale = max.getZ() - min.getZ() + 1;
   final float xOffset = min.getX() + xScale / 2;
   final float zOffset = min.getZ() + zScale / 2;
   final int endX = max.getX();
   final int endY = max.getY();
   final int endZ = max.getZ();
   for (int xx = min.getX(); xx <= endX; xx++) {
     final float dx = (xx - xOffset) / (xScale * 0.5f);
     for (int yy = min.getY(); yy <= endY; yy++) {
       final float dy = (yy - min.getY()) / yScale;
       for (int zz = min.getZ(); zz <= endZ; zz++) {
         final float dz = (zz - zOffset) / (zScale * 0.5f);
         if (dx * dx + dy * dy + dz * dz <= 1.05) {
           if (ignoreAir
               && !parent.getBlockMaterial(xx, yy, zz).isMaterial(VanillaMaterials.AIR)) {
             continue;
           }
           parent.setBlockMaterial(xx, yy, zz, picker.get(false));
         }
       }
     }
   }
 }
示例#2
0
 @Override
 public void fill(boolean ignoreAir) {
   final int endX = max.getX();
   final int endY = max.getY();
   final int endZ = max.getZ();
   for (int xx = min.getX(); xx <= endX; xx++) {
     for (int yy = min.getY(); yy <= endY; yy++) {
       for (int zz = min.getZ(); zz <= endZ; zz++) {
         if (!ignoreAir || !parent.getBlockMaterial(xx, yy, zz).isMaterial(VanillaMaterials.AIR)) {
           parent.setBlockMaterial(xx, yy, zz, picker.get(isOuter(xx, yy, zz)));
         }
       }
     }
   }
 }
示例#3
0
 @Override
 public void randomFill(float odd, boolean ignoreAir) {
   final int endX = max.getX();
   final int endY = max.getY();
   final int endZ = max.getZ();
   for (int xx = min.getX(); xx <= endX; xx++) {
     for (int yy = min.getY(); yy <= endY; yy++) {
       for (int zz = min.getZ(); zz <= endZ; zz++) {
         if (parent.getRandom().nextFloat() > odd) {
           continue;
         }
         if (!ignoreAir || !parent.getBlockMaterial(xx, yy, zz).isMaterial(VanillaMaterials.AIR)) {
           parent.setBlockMaterial(xx, yy, zz, picker.get(isOuter(xx, yy, zz)));
         }
       }
     }
   }
 }