Camellias_

Untitled

Jun 10th, 2019
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.75 KB | None | 0 0
  1.     /**
  2.      * Standard ore generation helper. Vanilla uses this to generate most ores.
  3.      * The main difference between this and {@link #genStandardOre2} is that this takes min and max heights, while
  4.      * genStandardOre2 takes center and spread.
  5.      */
  6.     protected void genStandardOre1(World worldIn, Random random, int blockCount, WorldGenerator generator, int minHeight, int maxHeight)
  7.     {
  8.         if (maxHeight < minHeight)
  9.         {
  10.             int i = minHeight;
  11.             minHeight = maxHeight;
  12.             maxHeight = i;
  13.         }
  14.         else if (maxHeight == minHeight)
  15.         {
  16.             if (minHeight < 255)
  17.             {
  18.                 ++maxHeight;
  19.             }
  20.             else
  21.             {
  22.                 --minHeight;
  23.             }
  24.         }
  25.  
  26.         for (int j = 0; j < blockCount; ++j)
  27.         {
  28.             BlockPos blockpos = this.chunkPos.add(random.nextInt(16), random.nextInt(maxHeight - minHeight) + minHeight, random.nextInt(16));
  29.             generator.generate(worldIn, random, blockpos);
  30.         }
  31.     }
  32.  
  33.     /**
  34.      * Standard ore generation helper. Vanilla uses this to generate Lapis Lazuli.
  35.      * The main difference between this and {@link #genStandardOre1} is that this takes takes center and spread, while
  36.      * genStandardOre1 takes min and max heights.
  37.      */
  38.     protected void genStandardOre2(World worldIn, Random random, int blockCount, WorldGenerator generator, int centerHeight, int spread)
  39.     {
  40.         for (int i = 0; i < blockCount; ++i)
  41.         {
  42.             BlockPos blockpos = this.chunkPos.add(random.nextInt(16), random.nextInt(spread) + random.nextInt(spread) + centerHeight - spread, random.nextInt(16));
  43.             generator.generate(worldIn, random, blockpos);
  44.         }
  45.     }
Advertisement
Add Comment
Please, Sign In to add comment