Search in sources :

Example 1 with Chest

use of org.bukkit.material.Chest in project Glowstone by GlowstoneMC.

the class GlowDungeon method generate.

@Override
public boolean generate(World world, Random random, StructureBoundingBox genBoundingBox, BlockStateDelegate delegate) {
    if (!super.generate(world, random, boundingBox, delegate)) {
        return false;
    }
    boundingBox.offset(new Vector(-radiusX, -1, -radiusZ));
    StructureBuilder builder = new StructureBuilder(world, this, genBoundingBox, delegate);
    if (!canPlace(builder)) {
        return false;
    }
    Map<StructureMaterial, Integer> stones = new HashMap<>();
    builder.addRandomMaterial(stones, 1, Material.COBBLESTONE, 0);
    builder.addRandomMaterial(stones, 3, Material.MOSSY_COBBLESTONE, 0);
    for (int x = 0; x < sizeX; x++) {
        for (int z = 0; z < sizeZ; z++) {
            for (int y = HEIGHT - 1; y >= 0; y--) {
                BlockState state = builder.getBlockState(new Vector(x, y, z));
                if (y > 0 && x > 0 && z > 0 && x < sizeX - 1 && y < HEIGHT - 1 && z < sizeZ - 1) {
                    // empty space inside
                    builder.setBlock(new Vector(x, y, z), Material.AIR);
                } else if (!builder.getBlockState(new Vector(x, y - 1, z)).getType().isSolid()) {
                    // cleaning walls from non solid materials (because of air gaps below)
                    builder.setBlock(new Vector(x, y, z), Material.AIR);
                } else if (state.getType().isSolid()) {
                    // preserve the air gaps
                    if (y == 0) {
                        builder.setBlockWithRandomMaterial(new Vector(x, y, z), random, stones);
                    } else {
                        builder.setBlock(new Vector(x, y, z), Material.COBBLESTONE);
                    }
                }
            }
        }
    }
    RandomItemsContent chestContent = new RandomItemsContent();
    chestContent.addItem(new RandomAmountItem(Material.SADDLE, 1, 1), 10);
    chestContent.addItem(new RandomAmountItem(Material.IRON_INGOT, 1, 4), 10);
    chestContent.addItem(new RandomAmountItem(Material.BREAD, 1, 1), 10);
    chestContent.addItem(new RandomAmountItem(Material.WHEAT, 1, 4), 10);
    chestContent.addItem(new RandomAmountItem(Material.SULPHUR, 1, 4), 10);
    chestContent.addItem(new RandomAmountItem(Material.STRING, 1, 4), 10);
    chestContent.addItem(new RandomAmountItem(Material.BUCKET, 1, 1), 10);
    chestContent.addItem(new RandomAmountItem(Material.GOLDEN_APPLE, 1, 1), 1);
    chestContent.addItem(new RandomAmountItem(Material.REDSTONE, 1, 4), 10);
    chestContent.addItem(new RandomAmountItem(Material.GOLD_RECORD, 1, 1), 4);
    chestContent.addItem(new RandomAmountItem(Material.GREEN_RECORD, 1, 1), 4);
    chestContent.addItem(new RandomAmountItem(Material.NAME_TAG, 1, 1), 10);
    chestContent.addItem(new RandomAmountItem(Material.GOLD_BARDING, 1, 1), 2);
    chestContent.addItem(new RandomAmountItem(Material.IRON_BARDING, 1, 1), 5);
    chestContent.addItem(new RandomAmountItem(Material.DIAMOND_BARDING, 1, 1), 1);
    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < 3; j++) {
            int x = random.nextInt((radiusX << 1) - 1) + 1;
            int z = random.nextInt((radiusZ << 1) - 1) + 1;
            if (builder.getBlockState(new Vector(x, 1, z)).getType() == Material.AIR) {
                BlockFace face = null;
                int solidBlocksCount = 0;
                if (builder.getBlockState(new Vector(x - 1, 1, z)).getType() == Material.COBBLESTONE) {
                    solidBlocksCount++;
                    face = BlockFace.EAST;
                }
                if (builder.getBlockState(new Vector(x + 1, 1, z)).getType() == Material.COBBLESTONE) {
                    solidBlocksCount++;
                    face = BlockFace.WEST;
                }
                if (builder.getBlockState(new Vector(x, 1, z - 1)).getType() == Material.COBBLESTONE) {
                    solidBlocksCount++;
                    face = BlockFace.SOUTH;
                }
                if (builder.getBlockState(new Vector(x, 1, z + 1)).getType() == Material.COBBLESTONE) {
                    solidBlocksCount++;
                    face = BlockFace.NORTH;
                }
                if (solidBlocksCount == 1) {
                    builder.createRandomItemsContainer(new Vector(x, 1, z), random, chestContent, new Chest(face), 8);
                    break;
                }
            }
        }
    }
    builder.createMobSpawner(new Vector(radiusX, 1, radiusZ), mobTypes[random.nextInt(mobTypes.length)]);
    GlowServer.logger.finer("dungeon generated: " + loc.getBlockX() + "," + loc.getBlockY() + "," + loc.getBlockZ());
    return true;
}
Also used : Chest(org.bukkit.material.Chest) BlockState(org.bukkit.block.BlockState) RandomAmountItem(net.glowstone.generator.objects.RandomItemsContent.RandomAmountItem) HashMap(java.util.HashMap) StructureBuilder(net.glowstone.generator.structures.util.StructureBuilder) BlockFace(org.bukkit.block.BlockFace) RandomItemsContent(net.glowstone.generator.objects.RandomItemsContent) StructureMaterial(net.glowstone.generator.structures.util.StructureBuilder.StructureMaterial) Vector(org.bukkit.util.Vector)

Example 2 with Chest

use of org.bukkit.material.Chest in project Glowstone by GlowstoneMC.

the class BlockChest method placeBlock.

@Override
public void placeBlock(GlowPlayer player, GlowBlockState state, BlockFace face, ItemStack holding, Vector clickedLoc) {
    super.placeBlock(player, state, face, holding, clickedLoc);
    MaterialData data = state.getData();
    if (data instanceof Chest) {
        Chest chest = (Chest) data;
        GlowBlock chestBlock = state.getBlock();
        BlockFace normalFacing = getOppositeBlockFace(player.getLocation(), false);
        Collection<BlockFace> attachedChests = searchChests(chestBlock);
        if (attachedChests.isEmpty()) {
            chest.setFacingDirection(normalFacing);
            state.setData(chest);
            return;
        } else if (attachedChests.size() > 1) {
            GlowServer.logger.warning("Chest placed near two other chests!");
            return;
        }
        BlockFace otherPart = attachedChests.iterator().next();
        GlowBlock otherPartBlock = chestBlock.getRelative(otherPart);
        if (getAttachedChest(otherPartBlock) != null) {
            GlowServer.logger.warning("Chest placed near already attached chest!");
            return;
        }
        BlockState otherPartState = otherPartBlock.getState();
        MaterialData otherPartData = otherPartState.getData();
        if (otherPartData instanceof Chest) {
            Chest otherChest = (Chest) otherPartData;
            BlockFace facing = getFacingDirection(normalFacing, otherChest.getFacing(), otherPart, player);
            chest.setFacingDirection(facing);
            state.setData(chest);
            otherChest.setFacingDirection(facing);
            otherPartState.setData(otherChest);
            otherPartState.update();
        } else {
            warnMaterialData(Chest.class, otherPartData);
        }
    } else {
        warnMaterialData(Chest.class, data);
    }
}
Also used : Chest(org.bukkit.material.Chest) GlowBlock(net.glowstone.block.GlowBlock) BlockState(org.bukkit.block.BlockState) GlowBlockState(net.glowstone.block.GlowBlockState) BlockFace(org.bukkit.block.BlockFace) MaterialData(org.bukkit.material.MaterialData)

Example 3 with Chest

use of org.bukkit.material.Chest in project Glowstone by GlowstoneMC.

the class BlockChest method blockInteract.

@Override
public boolean blockInteract(GlowPlayer player, GlowBlock block, BlockFace face, Vector clickedLoc) {
    BlockState state = block.getState();
    if (state instanceof org.bukkit.block.Chest) {
        org.bukkit.block.Chest chest = (org.bukkit.block.Chest) state;
        player.openInventory(chest.getInventory());
        player.incrementStatistic(Statistic.CHEST_OPENED);
        return true;
    }
    GlowServer.logger.warning("Calling blockInteract on BlockChest, but BlockState is " + state);
    return false;
}
Also used : Chest(org.bukkit.material.Chest) BlockState(org.bukkit.block.BlockState) GlowBlockState(net.glowstone.block.GlowBlockState)

Example 4 with Chest

use of org.bukkit.material.Chest in project Glowstone by GlowstoneMC.

the class GlowDesertTemple method generate.

@Override
public boolean generate(World world, Random random, StructureBoundingBox genBoundingBox, BlockStateDelegate delegate) {
    if (!super.generate(world, random, boundingBox, delegate)) {
        return false;
    }
    StructureBuilder builder = new StructureBuilder(world, this, genBoundingBox, delegate);
    for (int x = 0; x < 21; x++) {
        for (int z = 0; z < 21; z++) {
            builder.setBlockDownward(new Vector(x, 13, z), Material.SANDSTONE);
        }
    }
    builder.fill(new Vector(0, 14, 0), new Vector(20, 18, 20), Material.SANDSTONE);
    for (int i = 1; i <= 9; i++) {
        builder.fill(new Vector(i, i + 18, i), new Vector(20 - i, i + 18, 20 - i), Material.SANDSTONE);
        builder.fill(new Vector(i + 1, i + 18, i + 1), new Vector(19 - i, i + 18, 19 - i), Material.AIR);
    }
    // east tower
    builder.fill(new Vector(0, 18, 0), new Vector(4, 27, 4), Material.SANDSTONE, Material.AIR);
    builder.fill(new Vector(1, 28, 1), new Vector(3, 28, 3), Material.SANDSTONE);
    Stairs stairsN = new Stairs(Material.SANDSTONE_STAIRS);
    stairsN.setFacingDirection(getRelativeFacing(BlockFace.SOUTH));
    builder.setBlock(new Vector(2, 28, 0), stairsN.getItemType(), stairsN);
    Stairs stairsE = new Stairs(Material.SANDSTONE_STAIRS);
    stairsE.setFacingDirection(getRelativeFacing(BlockFace.WEST));
    builder.setBlock(new Vector(4, 28, 2), stairsE.getItemType(), stairsE);
    Stairs stairsS = new Stairs(Material.SANDSTONE_STAIRS);
    stairsS.setFacingDirection(getRelativeFacing(BlockFace.NORTH));
    builder.setBlock(new Vector(2, 28, 4), stairsS.getItemType(), stairsS);
    Stairs stairsW = new Stairs(Material.SANDSTONE_STAIRS);
    stairsW.setFacingDirection(getRelativeFacing(BlockFace.EAST));
    builder.setBlock(new Vector(0, 28, 2), stairsW.getItemType(), stairsW);
    builder.fill(new Vector(1, 19, 5), new Vector(3, 22, 11), Material.SANDSTONE);
    builder.fill(new Vector(2, 22, 4), new Vector(2, 24, 4), Material.AIR);
    builder.fill(new Vector(1, 19, 3), new Vector(2, 20, 3), Material.SANDSTONE);
    builder.setBlock(new Vector(1, 19, 2), Material.SANDSTONE);
    Step step = new Step(Material.SANDSTONE);
    builder.setBlock(new Vector(1, 20, 2), step.getItemType(), step);
    builder.setBlock(new Vector(2, 19, 2), stairsE.getItemType(), stairsE);
    for (int i = 0; i < 2; i++) {
        builder.setBlock(new Vector(2, 21 + i, 4 + i), stairsN.getItemType(), stairsN);
    }
    // west tower
    builder.fill(new Vector(16, 18, 0), new Vector(20, 27, 4), Material.SANDSTONE, Material.AIR);
    builder.fill(new Vector(17, 28, 1), new Vector(19, 28, 3), Material.SANDSTONE);
    builder.setBlock(new Vector(18, 28, 0), stairsN.getItemType(), stairsN);
    builder.setBlock(new Vector(20, 28, 2), stairsE.getItemType(), stairsE);
    builder.setBlock(new Vector(18, 28, 4), stairsS.getItemType(), stairsS);
    builder.setBlock(new Vector(16, 28, 2), stairsW.getItemType(), stairsW);
    builder.fill(new Vector(17, 19, 5), new Vector(19, 22, 11), Material.SANDSTONE);
    builder.fill(new Vector(18, 22, 4), new Vector(18, 24, 4), Material.AIR);
    builder.fill(new Vector(18, 19, 3), new Vector(19, 20, 3), Material.SANDSTONE);
    builder.setBlock(new Vector(19, 19, 2), Material.SANDSTONE);
    builder.setBlock(new Vector(19, 20, 2), step.getItemType(), step);
    builder.setBlock(new Vector(18, 19, 2), stairsW.getItemType(), stairsW);
    for (int i = 0; i < 2; i++) {
        builder.setBlock(new Vector(18, 21 + i, 4 + i), stairsN.getItemType(), stairsN);
    }
    // tower symbols
    for (int i = 0; i < 2; i++) {
        // front
        builder.fill(new Vector(1 + (i << 4), 20, 0), new Vector(1 + (i << 4), 21, 0), Material.SANDSTONE, 2);
        builder.fill(new Vector(2 + (i << 4), 20, 0), new Vector(2 + (i << 4), 21, 0), Material.STAINED_CLAY, 1);
        builder.fill(new Vector(3 + (i << 4), 20, 0), new Vector(3 + (i << 4), 21, 0), Material.SANDSTONE, 2);
        builder.setBlock(new Vector(1 + (i << 4), 22, 0), Material.STAINED_CLAY, 1);
        builder.setBlock(new Vector(2 + (i << 4), 22, 0), Material.SANDSTONE, 1);
        builder.setBlock(new Vector(3 + (i << 4), 22, 0), Material.STAINED_CLAY, 1);
        builder.setBlock(new Vector(1 + (i << 4), 23, 0), Material.SANDSTONE, 2);
        builder.setBlock(new Vector(2 + (i << 4), 23, 0), Material.STAINED_CLAY, 1);
        builder.setBlock(new Vector(3 + (i << 4), 23, 0), Material.SANDSTONE, 2);
        builder.setBlock(new Vector(1 + (i << 4), 24, 0), Material.STAINED_CLAY, 1);
        builder.setBlock(new Vector(2 + (i << 4), 24, 0), Material.SANDSTONE, 1);
        builder.setBlock(new Vector(3 + (i << 4), 24, 0), Material.STAINED_CLAY, 1);
        builder.fill(new Vector(1 + (i << 4), 25, 0), new Vector(3 + (i << 4), 25, 0), Material.STAINED_CLAY, 1);
        builder.fill(new Vector(1 + (i << 4), 26, 0), new Vector(3 + (i << 4), 26, 0), Material.SANDSTONE, 2);
        // side
        builder.fill(new Vector(i * 20, 20, 1), new Vector(i * 20, 21, 1), Material.SANDSTONE, 2);
        builder.fill(new Vector(i * 20, 20, 2), new Vector(i * 20, 21, 2), Material.STAINED_CLAY, 1);
        builder.fill(new Vector(i * 20, 20, 3), new Vector(i * 20, 21, 3), Material.SANDSTONE, 2);
        builder.setBlock(new Vector(i * 20, 22, 1), Material.STAINED_CLAY, 1);
        builder.setBlock(new Vector(i * 20, 22, 2), Material.SANDSTONE, 1);
        builder.setBlock(new Vector(i * 20, 22, 3), Material.STAINED_CLAY, 1);
        builder.setBlock(new Vector(i * 20, 23, 1), Material.SANDSTONE, 2);
        builder.setBlock(new Vector(i * 20, 23, 2), Material.STAINED_CLAY, 1);
        builder.setBlock(new Vector(i * 20, 23, 3), Material.SANDSTONE, 2);
        builder.setBlock(new Vector(i * 20, 24, 1), Material.STAINED_CLAY, 1);
        builder.setBlock(new Vector(i * 20, 24, 2), Material.SANDSTONE, 1);
        builder.setBlock(new Vector(i * 20, 24, 3), Material.STAINED_CLAY, 1);
        builder.fill(new Vector(i * 20, 25, 1), new Vector(i * 20, 25, 3), Material.STAINED_CLAY, 1);
        builder.fill(new Vector(i * 20, 26, 1), new Vector(i * 20, 26, 3), Material.SANDSTONE, 2);
    }
    // front entrance
    builder.fill(new Vector(8, 18, 1), new Vector(12, 22, 4), Material.SANDSTONE, Material.AIR);
    builder.fill(new Vector(9, 19, 0), new Vector(11, 21, 4), Material.AIR);
    builder.fill(new Vector(9, 19, 1), new Vector(9, 20, 1), Material.SANDSTONE, 2);
    builder.fill(new Vector(11, 19, 1), new Vector(11, 20, 1), Material.SANDSTONE, 2);
    builder.fill(new Vector(9, 21, 1), new Vector(11, 21, 1), Material.SANDSTONE, 2);
    builder.fill(new Vector(8, 18, 0), new Vector(8, 21, 0), Material.SANDSTONE);
    builder.fill(new Vector(12, 18, 0), new Vector(12, 21, 0), Material.SANDSTONE);
    builder.fill(new Vector(8, 22, 0), new Vector(12, 22, 0), Material.SANDSTONE, 2);
    builder.setBlock(new Vector(8, 23, 0), Material.SANDSTONE, 2);
    builder.setBlock(new Vector(9, 23, 0), Material.STAINED_CLAY, 1);
    builder.setBlock(new Vector(10, 23, 0), Material.SANDSTONE, 1);
    builder.setBlock(new Vector(11, 23, 0), Material.STAINED_CLAY, 1);
    builder.setBlock(new Vector(12, 23, 0), Material.SANDSTONE, 2);
    builder.fill(new Vector(9, 24, 0), new Vector(11, 24, 0), Material.SANDSTONE, 2);
    // east entrance
    builder.fill(new Vector(5, 23, 9), new Vector(5, 25, 11), Material.SANDSTONE, 2);
    builder.fill(new Vector(6, 25, 9), new Vector(6, 25, 11), Material.SANDSTONE);
    builder.fill(new Vector(5, 23, 10), new Vector(6, 24, 10), Material.AIR);
    // west entrance
    builder.fill(new Vector(15, 23, 9), new Vector(15, 25, 11), Material.SANDSTONE, 2);
    builder.fill(new Vector(14, 25, 9), new Vector(14, 25, 11), Material.SANDSTONE);
    builder.fill(new Vector(14, 23, 10), new Vector(15, 24, 10), Material.AIR);
    // corridor to east tower
    builder.fill(new Vector(4, 19, 1), new Vector(8, 21, 3), Material.SANDSTONE, Material.AIR);
    builder.fill(new Vector(4, 19, 2), new Vector(8, 20, 2), Material.AIR);
    // corridor to west tower
    builder.fill(new Vector(12, 19, 1), new Vector(16, 21, 3), Material.SANDSTONE, Material.AIR);
    builder.fill(new Vector(12, 19, 2), new Vector(16, 20, 2), Material.AIR);
    // pillars in the middle of 1st floor
    builder.fill(new Vector(8, 19, 8), new Vector(8, 21, 8), Material.SANDSTONE, 2);
    builder.fill(new Vector(12, 19, 8), new Vector(12, 21, 8), Material.SANDSTONE, 2);
    builder.fill(new Vector(12, 19, 12), new Vector(12, 21, 12), Material.SANDSTONE, 2);
    builder.fill(new Vector(8, 19, 12), new Vector(8, 21, 12), Material.SANDSTONE, 2);
    // 2nd floor
    builder.fill(new Vector(5, 22, 5), new Vector(15, 22, 15), Material.SANDSTONE);
    builder.fill(new Vector(9, 22, 9), new Vector(11, 22, 11), Material.AIR);
    // east and west corridors
    builder.fill(new Vector(3, 19, 5), new Vector(3, 20, 11), Material.AIR);
    builder.fill(new Vector(4, 21, 5), new Vector(4, 21, 16), Material.SANDSTONE);
    builder.fill(new Vector(17, 19, 5), new Vector(17, 20, 11), Material.AIR);
    builder.fill(new Vector(16, 21, 5), new Vector(16, 21, 16), Material.SANDSTONE);
    builder.fill(new Vector(2, 19, 12), new Vector(2, 19, 18), Material.SANDSTONE);
    builder.fill(new Vector(18, 19, 12), new Vector(18, 19, 18), Material.SANDSTONE);
    builder.fill(new Vector(3, 19, 18), new Vector(18, 19, 18), Material.SANDSTONE);
    for (int i = 0; i < 7; i++) {
        builder.setBlock(new Vector(4, 19, 5 + (i << 1)), Material.SANDSTONE, 2);
        builder.setBlock(new Vector(4, 20, 5 + (i << 1)), Material.SANDSTONE, 1);
        builder.setBlock(new Vector(16, 19, 5 + (i << 1)), Material.SANDSTONE, 2);
        builder.setBlock(new Vector(16, 20, 5 + (i << 1)), Material.SANDSTONE, 1);
    }
    // floor symbols
    builder.setBlock(new Vector(9, 18, 9), Material.STAINED_CLAY, 1);
    builder.setBlock(new Vector(11, 18, 9), Material.STAINED_CLAY, 1);
    builder.setBlock(new Vector(11, 18, 11), Material.STAINED_CLAY, 1);
    builder.setBlock(new Vector(9, 18, 11), Material.STAINED_CLAY, 1);
    builder.setBlock(new Vector(10, 18, 10), Material.STAINED_CLAY, 11);
    builder.fill(new Vector(10, 18, 7), new Vector(10, 18, 8), Material.STAINED_CLAY, 1);
    builder.fill(new Vector(12, 18, 10), new Vector(13, 18, 10), Material.STAINED_CLAY, 1);
    builder.fill(new Vector(10, 18, 12), new Vector(10, 18, 13), Material.STAINED_CLAY, 1);
    builder.fill(new Vector(7, 18, 10), new Vector(8, 18, 10), Material.STAINED_CLAY, 1);
    // trap chamber
    builder.fill(new Vector(8, 0, 8), new Vector(12, 3, 12), Material.SANDSTONE, 2);
    builder.fill(new Vector(8, 4, 8), new Vector(12, 4, 12), Material.SANDSTONE, 1);
    builder.fill(new Vector(8, 5, 8), new Vector(12, 5, 12), Material.SANDSTONE, 2);
    builder.fill(new Vector(8, 6, 8), new Vector(12, 13, 12), Material.SANDSTONE);
    builder.fill(new Vector(9, 3, 9), new Vector(11, 17, 11), Material.AIR);
    builder.fill(new Vector(9, 1, 9), new Vector(11, 1, 11), Material.TNT);
    builder.fill(new Vector(9, 2, 9), new Vector(11, 2, 11), Material.SANDSTONE, 2);
    builder.fill(new Vector(10, 3, 8), new Vector(10, 4, 8), Material.AIR);
    builder.setBlock(new Vector(10, 3, 7), Material.SANDSTONE, 2);
    builder.setBlock(new Vector(10, 4, 7), Material.SANDSTONE, 1);
    builder.fill(new Vector(12, 3, 10), new Vector(12, 4, 10), Material.AIR);
    builder.setBlock(new Vector(13, 3, 10), Material.SANDSTONE, 2);
    builder.setBlock(new Vector(13, 4, 10), Material.SANDSTONE, 1);
    builder.fill(new Vector(10, 3, 12), new Vector(10, 4, 12), Material.AIR);
    builder.setBlock(new Vector(10, 3, 13), Material.SANDSTONE, 2);
    builder.setBlock(new Vector(10, 4, 13), Material.SANDSTONE, 1);
    builder.fill(new Vector(8, 3, 10), new Vector(8, 4, 10), Material.AIR);
    builder.setBlock(new Vector(7, 3, 10), Material.SANDSTONE, 2);
    builder.setBlock(new Vector(7, 4, 10), Material.SANDSTONE, 1);
    builder.setBlock(new Vector(10, 3, 10), Material.STONE_PLATE);
    RandomItemsContent chestContent = getChestContent();
    if (!hasPlacedChest0) {
        hasPlacedChest0 = builder.createRandomItemsContainer(new Vector(10, 3, 12), random, chestContent, new Chest(getRelativeFacing(BlockFace.NORTH)), random.nextInt(5) + 2);
    }
    if (!hasPlacedChest1) {
        hasPlacedChest1 = builder.createRandomItemsContainer(new Vector(8, 3, 10), random, chestContent, new Chest(getRelativeFacing(BlockFace.EAST)), random.nextInt(5) + 2);
    }
    if (!hasPlacedChest2) {
        hasPlacedChest2 = builder.createRandomItemsContainer(new Vector(10, 3, 8), random, chestContent, new Chest(getRelativeFacing(BlockFace.SOUTH)), random.nextInt(5) + 2);
    }
    if (!hasPlacedChest3) {
        hasPlacedChest3 = builder.createRandomItemsContainer(new Vector(12, 3, 10), random, chestContent, new Chest(getRelativeFacing(BlockFace.WEST)), random.nextInt(5) + 2);
    }
    return true;
}
Also used : Chest(org.bukkit.material.Chest) StructureBuilder(net.glowstone.generator.structures.util.StructureBuilder) RandomItemsContent(net.glowstone.generator.objects.RandomItemsContent) Stairs(org.bukkit.material.Stairs) Step(org.bukkit.material.Step) Vector(org.bukkit.util.Vector)

Aggregations

Chest (org.bukkit.material.Chest)4 BlockState (org.bukkit.block.BlockState)3 GlowBlockState (net.glowstone.block.GlowBlockState)2 RandomItemsContent (net.glowstone.generator.objects.RandomItemsContent)2 StructureBuilder (net.glowstone.generator.structures.util.StructureBuilder)2 BlockFace (org.bukkit.block.BlockFace)2 Vector (org.bukkit.util.Vector)2 HashMap (java.util.HashMap)1 GlowBlock (net.glowstone.block.GlowBlock)1 RandomAmountItem (net.glowstone.generator.objects.RandomItemsContent.RandomAmountItem)1 StructureMaterial (net.glowstone.generator.structures.util.StructureBuilder.StructureMaterial)1 MaterialData (org.bukkit.material.MaterialData)1 Stairs (org.bukkit.material.Stairs)1 Step (org.bukkit.material.Step)1