Made lush caves generate higher up too again

This commit is contained in:
Ellpeck 2016-11-06 17:12:49 +01:00
parent e469c1d634
commit 642ff7b965

View file

@ -10,6 +10,7 @@
package de.ellpeck.actuallyadditions.mod.gen; package de.ellpeck.actuallyadditions.mod.gen;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheMiscBlocks; import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheMiscBlocks;
import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheWildPlants; import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheWildPlants;
@ -80,7 +81,7 @@ public class OreGen implements IWorldGenerator{
int randConst = 0x969ce69d;//so that it won't generate the same numbers as other mod that does the same thing int randConst = 0x969ce69d;//so that it won't generate the same numbers as other mod that does the same thing
Random chunkRand = new Random(randConst ^ world.getSeed() ^ (chunkX*29+chunkZ*31)); Random chunkRand = new Random(randConst ^ world.getSeed() ^ (chunkX*29+chunkZ*31));
if(chunkRand.nextInt(ConfigIntValues.LUSH_CAVE_CHANCE.getValue()) <= 0){ if(chunkRand.nextInt(ConfigIntValues.LUSH_CAVE_CHANCE.getValue()) <= 0){
BlockPos randPos = new BlockPos(chunkX*16+chunkRand.nextInt(16)+8, 64, chunkZ*16+chunkRand.nextInt(16)+8); BlockPos randPos = world.getTopSolidOrLiquidBlock(new BlockPos(chunkX*16+chunkRand.nextInt(16)+8, 0, chunkZ*16+chunkRand.nextInt(16)+8));
BlockPos pos = randPos.down(MathHelper.getRandomIntegerInRange(chunkRand, 15, randPos.getY()-15)); BlockPos pos = randPos.down(MathHelper.getRandomIntegerInRange(chunkRand, 15, randPos.getY()-15));
this.caveGen.generate(world, chunkRand, pos, box); this.caveGen.generate(world, chunkRand, pos, box);
} }