use of net.glowstone.generator.objects.Flower in project Glowstone by GlowstoneMC.
the class FlowerForestPopulator method populateOnGround.
@Override
public void populateOnGround(World world, Random random, Chunk chunk) {
super.populateOnGround(world, random, chunk);
int sourceX = chunk.getX() << 4;
int sourceZ = chunk.getZ() << 4;
for (int i = 0; i < 100; i++) {
int x = sourceX + random.nextInt(16);
int z = sourceZ + random.nextInt(16);
int y = random.nextInt(world.getHighestBlockYAt(x, z) + 32);
double noise = (noiseGen.noise(x, z, 0.5D, 2.0D) + 1.0D) / 2.0D;
noise = noise < 0 ? 0 : noise > 0.9999D ? 0.9999D : noise;
FlowerType flower = FLOWERS[(int) (noise * FLOWERS.length)];
new Flower(flower).generate(world, random, x, y, z);
}
}
use of net.glowstone.generator.objects.Flower in project Glowstone by GlowstoneMC.
the class FlowerDecorator 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);
// the flower can change on each decoration pass
FlowerType flower = getRandomFlower(random, flowers);
if (flower != null) {
new Flower(flower).generate(world, random, sourceX, sourceY, sourceZ);
}
}
use of net.glowstone.generator.objects.Flower 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