ComputerCraft32

Generation

Jul 22nd, 2020
748
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.37 KB | None | 0 0
  1.  
  2.                     float value = noise.GetPerlinFractal(worldLoc.x, worldLoc.y, worldLoc.z);
  3.                  
  4.                    
  5.                    
  6.                     if (y <= waterHeight) {
  7.                         for (int i = y; i <= waterHeight; i++) {
  8.                             chunk.addBlock(x, i + 1, z, BlocksConfig.getInstance().getBlockRegistry().get(BlockIds.WATER));
  9.                         }
  10.                     }
  11.  
  12.                     if (value - ((y - 128) * 0.01) >= 0) {
  13.                         if ((y > waterHeight && y < waterHeight + 2)) {
  14.                             chunk.addBlock(x, y, z, BlocksConfig.getInstance().getBlockRegistry().get(BlockIds.SAND));
  15.                         } else {
  16.                             chunk.addBlock(x, y, z, BlocksConfig.getInstance().getBlockRegistry().get(BlockIds.GRASS));
  17.                         }
  18.  
  19.                     }
  20.                     if (y < 105) {
  21.                         if ((Math.pow(noise2.GetNoise(worldLoc.x, worldLoc.y, worldLoc.z), 2) + Math.pow(noise3.GetNoise(worldLoc.x, worldLoc.y, worldLoc.z), 2)) < 0.02) {
  22.                             if (!(chunk.getBlock(x, y + 1, z) == (BlocksConfig.getInstance().getBlockRegistry().get(BlockIds.WATER)))) {
  23.                                 chunk.addBlock(x, y, z, null);
  24.                             }
  25.                         }
  26.                     }
Advertisement
Add Comment
Please, Sign In to add comment