Search in sources :

Example 1 with WorldGenDesertWells

use of net.minecraft.world.gen.feature.WorldGenDesertWells in project Realistic-Terrain-Generation by Team-RTG.

the class DecoDesertWell method generate.

@Override
public void generate(IRealisticBiome biome, RTGWorld rtgWorld, Random rand, int worldX, int worldZ, float strength, float river, boolean hasPlacedVillageBlocks) {
    if (this.allowed) {
        WorldGenerator worldGenerator = new WorldGenDesertWells();
        this.setLoops((this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops);
        for (int i = 0; i < this.loops; i++) {
            if (rand.nextInt(this.chance) == 0) {
                int intX = worldX + rand.nextInt(16) + 8;
                int intY = rand.nextInt(this.maxY);
                int intZ = worldZ + rand.nextInt(16) + 8;
                if (intY <= this.maxY) {
                    worldGenerator.generate(rtgWorld.world, rand, new BlockPos(intX, intY, intZ));
                }
            }
        }
    }
}
Also used : WorldGenerator(net.minecraft.world.gen.feature.WorldGenerator) WorldGenDesertWells(net.minecraft.world.gen.feature.WorldGenDesertWells) BlockPos(net.minecraft.util.math.BlockPos)

Aggregations

BlockPos (net.minecraft.util.math.BlockPos)1 WorldGenDesertWells (net.minecraft.world.gen.feature.WorldGenDesertWells)1 WorldGenerator (net.minecraft.world.gen.feature.WorldGenerator)1