use of net.glowstone.generator.objects.DoubleTallPlant in project Glowstone by GlowstoneMC.
the class DoublePlantDecorator method decorate.
@Override
public void decorate(World world, Random random, Chunk source) {
int sourceX = (source.getX() << 4) + random.nextInt(16);
int sourceZ = (source.getZ() << 4) + random.nextInt(16);
int sourceY = random.nextInt(world.getHighestBlockYAt(sourceX, sourceZ) + 32);
DoublePlantSpecies species = getRandomDoublePlant(random, doublePlants);
new DoubleTallPlant(species).generate(world, random, sourceX, sourceY, sourceZ);
}
use of net.glowstone.generator.objects.DoubleTallPlant in project Glowstone by GlowstoneMC.
the class ForestPopulator method populateOnGround.
@Override
public void populateOnGround(World world, Random random, Chunk chunk) {
int sourceX = chunk.getX() << 4;
int sourceZ = chunk.getZ() << 4;
int amount = random.nextInt(5) - doublePlantLoweringAmount;
int i = 0;
while (i < amount) {
for (int j = 0; j < 5; j++, i++) {
int x = sourceX + random.nextInt(16);
int z = sourceZ + random.nextInt(16);
int y = random.nextInt(world.getHighestBlockYAt(x, z) + 32);
DoublePlantSpecies species = DOUBLE_PLANTS[random.nextInt(DOUBLE_PLANTS.length)];
if (new DoubleTallPlant(species).generate(world, random, x, y, z)) {
i++;
break;
}
}
}
super.populateOnGround(world, random, chunk);
}
use of net.glowstone.generator.objects.DoubleTallPlant in project Glowstone by GlowstoneMC.
the class PlainsPopulator method populateOnGround.
@Override
public void populateOnGround(World world, Random random, Chunk chunk) {
int sourceX = chunk.getX() << 4;
int sourceZ = chunk.getZ() << 4;
int flowerAmount = 15;
int tallGrassAmount = 5;
if (noiseGen.noise(sourceX + 8, sourceZ + 8, 0.5D, 2.0D) >= -0.8D) {
flowerAmount = 4;
tallGrassAmount = 10;
for (int i = 0; i < 7; i++) {
int x = sourceX + random.nextInt(16);
int z = sourceZ + random.nextInt(16);
int y = random.nextInt(world.getHighestBlockYAt(x, z) + 32);
new DoubleTallPlant(DoublePlantSpecies.DOUBLE_TALLGRASS).generate(world, random, x, y, z);
}
}
FlowerType flower = FlowerType.DANDELION;
if (noiseGen.noise(sourceX + 8, sourceZ + 8, 0.5D, 2.0D) < -0.8D) {
flower = TULIPS[random.nextInt(TULIPS.length)];
} else if (random.nextInt(3) > 0) {
flower = FLOWERS[random.nextInt(FLOWERS.length)];
}
for (int i = 0; i < flowerAmount; i++) {
int x = sourceX + random.nextInt(16);
int z = sourceZ + random.nextInt(16);
int y = random.nextInt(world.getHighestBlockYAt(x, z) + 32);
new Flower(flower).generate(world, random, x, y, z);
}
for (int i = 0; i < tallGrassAmount; i++) {
int x = sourceX + random.nextInt(16);
int z = sourceZ + random.nextInt(16);
int y = random.nextInt(world.getHighestBlockYAt(x, z) << 1);
new TallGrass(new LongGrass(GrassSpecies.NORMAL)).generate(world, random, x, y, z);
}
super.populateOnGround(world, random, chunk);
}
Aggregations