Search in sources :

Example 1 with WorldGenDeadBush

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

the class DecoDeadBush 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), DEAD_BUSH)) {
            WorldGenerator worldGenerator = new WorldGenDeadBush();
            int loopCount = this.loops;
            loopCount = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : loopCount;
            for (int i = 0; i < loopCount; i++) {
                // + 8;
                int intX = worldX + rand.nextInt(16);
                int intY = rand.nextInt(this.maxY);
                // + 8;
                int intZ = worldZ + rand.nextInt(16);
                if (intY <= this.maxY && rand.nextInt(this.chance) == 0) {
                    worldGenerator.generate(rtgWorld.world, rand, new BlockPos(intX, intY, intZ));
                }
            }
        }
    }
}
Also used : WorldGenerator(net.minecraft.world.gen.feature.WorldGenerator) WorldGenDeadBush(net.minecraft.world.gen.feature.WorldGenDeadBush) BlockPos(net.minecraft.util.math.BlockPos)

Aggregations

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