Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Standard ore generation helper. Vanilla uses this to generate most ores.
- * The main difference between this and {@link #genStandardOre2} is that this takes min and max heights, while
- * genStandardOre2 takes center and spread.
- */
- protected void genStandardOre1(World worldIn, Random random, int blockCount, WorldGenerator generator, int minHeight, int maxHeight)
- {
- if (maxHeight < minHeight)
- {
- int i = minHeight;
- minHeight = maxHeight;
- maxHeight = i;
- }
- else if (maxHeight == minHeight)
- {
- if (minHeight < 255)
- {
- ++maxHeight;
- }
- else
- {
- --minHeight;
- }
- }
- for (int j = 0; j < blockCount; ++j)
- {
- BlockPos blockpos = this.chunkPos.add(random.nextInt(16), random.nextInt(maxHeight - minHeight) + minHeight, random.nextInt(16));
- generator.generate(worldIn, random, blockpos);
- }
- }
- /**
- * Standard ore generation helper. Vanilla uses this to generate Lapis Lazuli.
- * The main difference between this and {@link #genStandardOre1} is that this takes takes center and spread, while
- * genStandardOre1 takes min and max heights.
- */
- protected void genStandardOre2(World worldIn, Random random, int blockCount, WorldGenerator generator, int centerHeight, int spread)
- {
- for (int i = 0; i < blockCount; ++i)
- {
- BlockPos blockpos = this.chunkPos.add(random.nextInt(16), random.nextInt(spread) + random.nextInt(spread) + centerHeight - spread, random.nextInt(16));
- generator.generate(worldIn, random, blockpos);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment