Search in sources :

Example 1 with WorldGenReed

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

the class DecoReed 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) {
        if (TerrainGen.decorate(rtgWorld.world, rand, new BlockPos(worldX, 0, worldZ), REED)) {
            WorldGenerator worldGenerator = new WorldGenReed();
            this.setLoops((this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops);
            for (int i = 0; i < this.loops; i++) {
                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) BlockPos(net.minecraft.util.math.BlockPos) WorldGenReed(net.minecraft.world.gen.feature.WorldGenReed)

Aggregations

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