Search in sources :

Example 1 with JungleBush

use of net.glowstone.generator.objects.trees.JungleBush in project Glowstone by GlowstoneMC.

the class JunglePopulator method populateOnGround.

@Override
public void populateOnGround(World world, Random random, Chunk chunk) {
    int sourceX = chunk.getX() << 4;
    int sourceZ = chunk.getZ() << 4;
    for (int i = 0; i < 7; i++) {
        int x = sourceX + random.nextInt(16);
        int z = sourceZ + random.nextInt(16);
        int y = world.getHighestBlockYAt(x, z);
        Block sourceBlock = world.getBlockAt(x, y, z);
        BlockStateDelegate delegate = new BlockStateDelegate();
        JungleBush bush = new JungleBush(random, sourceBlock.getLocation(), delegate);
        if (bush.generate()) {
            delegate.updateBlockStates();
        }
    }
    super.populateOnGround(world, random, chunk);
    melonDecorator.populate(world, random, chunk);
}
Also used : BlockStateDelegate(net.glowstone.util.BlockStateDelegate) Block(org.bukkit.block.Block) JungleBush(net.glowstone.generator.objects.trees.JungleBush)

Aggregations

JungleBush (net.glowstone.generator.objects.trees.JungleBush)1 BlockStateDelegate (net.glowstone.util.BlockStateDelegate)1 Block (org.bukkit.block.Block)1