Exemplo n.º 1
0
 private void finalizeSurface(World world, int x, int y, int z) {
   for (byte px = 0; px < 16; px++) {
     for (byte pz = 0; pz < 16; pz++) {
       for (byte py = -1; py < 4; py++) {
         final Block block = world.getBlock(x + px, y + py, z + pz, world);
         if (block.isAtSurface()) {
           final BlockMaterial material = block.getMaterial();
           if (material == VanillaMaterials.DIRT) {
             final BlockMaterial top;
             final Biome biome = block.getBiomeType();
             if (biome instanceof GrassyBiome) {
               top = ((GrassyBiome) biome).getTopCover();
             } else {
               top = VanillaMaterials.GRASS;
             }
             block.setMaterial(top);
           } else if (material == VanillaMaterials.STATIONARY_WATER
               && block.translate(0, 1, 0).isMaterial(VanillaMaterials.AIR)) {
             if (block.getBiomeType() instanceof IcyBiome) {
               block.setMaterial(VanillaMaterials.ICE);
             }
           }
         }
       }
     }
   }
 }
 /**
  * Gets if rain is falling on top of the block specified
  *
  * @param block to check
  * @return True if rain is falling on the Block, false if not
  */
 public static boolean isRaining(Block block) {
   return block.getWorld().getData().get(VanillaData.WORLD_WEATHER).isRaining()
       && block.isAtSurface();
 }