Search in sources :

Example 1 with GlowDesertWell

use of net.glowstone.generator.structures.GlowDesertWell in project Glowstone by GlowstoneMC.

the class DesertWellDecorator method decorate.

@Override
public void decorate(World world, Random random, Chunk source) {
    if (random.nextInt(1000) == 0) {
        int x = (source.getX() << 4) + random.nextInt(16);
        int z = (source.getZ() << 4) + random.nextInt(16);
        int y = world.getHighestBlockYAt(x, z);
        GlowDesertWell well = new GlowDesertWell(new Location(world, x, y, z));
        BlockStateDelegate delegate = new BlockStateDelegate();
        if (well.generate(world, random, new StructureBoundingBox(new Vector(x - 15, 1, z - 15), new Vector(x + 15, 511, z + 15)), delegate)) {
            delegate.updateBlockStates();
        }
    }
}
Also used : GlowDesertWell(net.glowstone.generator.structures.GlowDesertWell) BlockStateDelegate(net.glowstone.util.BlockStateDelegate) StructureBoundingBox(net.glowstone.generator.structures.util.StructureBoundingBox) Vector(org.bukkit.util.Vector) Location(org.bukkit.Location)

Aggregations

GlowDesertWell (net.glowstone.generator.structures.GlowDesertWell)1 StructureBoundingBox (net.glowstone.generator.structures.util.StructureBoundingBox)1 BlockStateDelegate (net.glowstone.util.BlockStateDelegate)1 Location (org.bukkit.Location)1 Vector (org.bukkit.util.Vector)1