Package org.spout.vanilla.world.generator.structure

Examples of org.spout.vanilla.world.generator.structure.PieceCuboidBuilder


  }

  @Override
  public void place() {
    // Building objects
    final PieceCuboidBuilder box = new PieceCuboidBuilder(this);
    final SimpleBlockMaterialPicker picker = new SimpleBlockMaterialPicker();
    box.setPicker(picker);
    // Floor
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    box.setMinMax(-1, 0, 0, 5, 1, 6).fill();
    // Interior space
    picker.setOuterInnerMaterials(VanillaMaterials.AIR, VanillaMaterials.AIR);
    box.offsetMinMax(0, 2, 0, 0, 6, 0).fill();
    // The four corner columns
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    box.setMinMax(-1, 2, 0, 0, 6, 0).fill();
    box.offsetMinMax(0, 0, 6, 0, 0, 6).fill();
    box.offsetMinMax(5, 0, -6, 5, 0, -6).fill();
    box.offsetMinMax(0, 0, 6, 0, 0, 6).fill();
    box.setMinMax(-1, 2, 0, -1, 6, 1).fill();
    box.offsetMinMax(0, 0, 5, 0, 0, 5).fill();
    box.offsetMinMax(6, 0, -5, 6, 0, -5).fill();
    box.offsetMinMax(0, 0, 5, 0, 0, 5).fill();
    // Connect the corner columns horizontally at the ceiling to create gateways
    box.setMinMax(1, 6, 0, 3, 6, 0).fill();
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK_FENCE, VanillaMaterials.NETHER_BRICK_FENCE);
    box.offsetMinMax(0, -1, 0, 0, -1, 0).fill();
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    box.offsetMinMax(0, 1, 6, 0, 1, 6).fill();
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK_FENCE, VanillaMaterials.NETHER_BRICK_FENCE);
    box.offsetMinMax(0, -1, 0, 0, -1, 0).fill();
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    box.setMinMax(-1, 6, 2, -1, 6, 4).fill();
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK_FENCE, VanillaMaterials.NETHER_BRICK_FENCE);
    box.offsetMinMax(0, -1, 0, 0, -1, 0).fill();
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    box.offsetMinMax(6, 1, 0, 6, 1, 0).fill();
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK_FENCE, VanillaMaterials.NETHER_BRICK_FENCE);
    box.offsetMinMax(0, -1, 0, 0, -1, 0).fill();
    // Fill down to the ground
    for (int xx = -1; xx <= 5; xx++) {
      for (int zz = 0; zz <= 6; zz++) {
        fillDownwards(xx, -1, zz, 50, VanillaMaterials.NETHER_BRICK);
      }
View Full Code Here


  }

  @Override
  public void place() {
    // Building objects
    final PieceCuboidBuilder box = new PieceCuboidBuilder(this);
    final SimpleBlockMaterialPicker air = new SimpleBlockMaterialPicker();
    air.setOuterInnerMaterials(VanillaMaterials.AIR, VanillaMaterials.AIR);
    final JungleTempleBlockMaterialPicker cobble = new JungleTempleBlockMaterialPicker(getRandom());
    // Basic shape: a box with two floors on full box
    box.setPicker(cobble);
    box.setMinMax(0, -4, 0, 11, 0, 14).fill();
    box.setMinMax(2, 1, 2, 9, 2, 2).fill();
    box.offsetMinMax(0, 0, 10, 0, 0, 10).fill();
    box.offsetMinMax(0, 0, -9, -7, 0, -1).fill();
    box.offsetMinMax(7, 0, 0, 7, 0, 0).fill();
    box.setMinMax(1, 3, 1, 10, 6, 1).fill();
    box.offsetMinMax(0, 0, 12, 0, 0, 12).fill();
    box.offsetMinMax(0, 0, -11, -9, 0, -1).fill();
    box.offsetMinMax(9, 0, 0, 9, 0, 0).fill();
    box.offsetMinMax(-8, 0, 0, -1, -3, 0).fill();
    box.offsetMinMax(0, 3, 0, 0, 3, 0).fill();
    box.offsetMinMax(1, 1, 1, -1, 1, -1).fill();
    box.offsetMinMax(1, 1, 1, -1, 1, -1).fill();
    // Holes like windows and doorways
    box.setPicker(air);
    box.setMinMax(3, 1, 3, 8, 2, 11).fill();
    box.setMinMax(4, 3, 6, 7, 3, 9).fill();
    box.setMinMax(2, 4, 2, 9, 5, 12).fill();
    box.setMinMax(4, 6, 5, 7, 6, 9).fill();
    box.offsetMinMax(1, 1, 1, -1, 1, -1).fill();
    box.offsetMinMax(0, -6, -4, 0, -5, -6).fill();
    box.offsetMinMax(0, 1, 10, 0, 0, 10).fill();
    box.offsetMinMax(0, 3, -11, 0, 3, -11).fill();
    box.offsetMinMax(0, 0, 12, 0, 0, 12).fill();
    setBlockMaterial(1, 5, 5, VanillaMaterials.AIR);
    setBlockMaterial(10, 5, 5, VanillaMaterials.AIR);
    setBlockMaterial(1, 5, 9, VanillaMaterials.AIR);
    setBlockMaterial(10, 5, 9, VanillaMaterials.AIR);
    // Decoration on the exterior walls
    box.setPicker(cobble);
    for (int i = 0; i < 2; i++) {
      box.setMinMax(2, 4, i * 14, 2, 5, i * 14).fill();
      box.offsetMinMax(2, 0, 0, 2, 0, 0).fill();
      box.offsetMinMax(3, 0, 0, 3, 0, 0).fill();
      box.offsetMinMax(2, 0, 0, 2, 0, 0).fill();
    }
    box.setMinMax(5, 6, 0, 6, 6, 0).fill();
    for (int i = 0; i < 2; i++) {
      for (int ii = 2; ii <= 12; ii += 2) {
        box.setMinMax(i * 11, 4, ii, i * 11, 5, ii).fill();
      }
      box.setMinMax(i * 11, 6, 5, i * 11, 6, 5).fill();
      box.offsetMinMax(0, 0, 4, 0, 0, 4).fill();
    }
    // Rooftop decoration
    box.setMinMax(2, 7, 2, 2, 9, 2).fill();
    box.offsetMinMax(7, 0, 0, 7, 0, 0).fill();
    box.offsetMinMax(-7, 0, 10, -7, 0, 10).fill();
    box.offsetMinMax(7, 0, 0, 7, 0, 0).fill();
    box.setMinMax(4, 9, 4, 4, 9, 4).fill();
    box.offsetMinMax(3, 0, 0, 3, 0, 0).fill();
    box.offsetMinMax(-3, 0, 6, -3, 0, 6).fill();
    box.offsetMinMax(3, 0, 0, 3, 0, 0).fill();
    box.setMinMax(5, 9, 7, 6, 9, 7).fill();
    // Place ALL the stairs!
    setBlockMaterial(5, 9, 6, VanillaMaterials.STAIRS_COBBLESTONE, (short) 2);
    setBlockMaterial(6, 9, 6, VanillaMaterials.STAIRS_COBBLESTONE, (short) 2);
    setBlockMaterial(5, 9, 8, VanillaMaterials.STAIRS_COBBLESTONE, (short) 3);
    setBlockMaterial(6, 9, 8, VanillaMaterials.STAIRS_COBBLESTONE, (short) 3);
    setBlockMaterial(4, 0, 0, VanillaMaterials.STAIRS_COBBLESTONE, (short) 2);
    setBlockMaterial(5, 0, 0, VanillaMaterials.STAIRS_COBBLESTONE, (short) 2);
    setBlockMaterial(6, 0, 0, VanillaMaterials.STAIRS_COBBLESTONE, (short) 2);
    setBlockMaterial(7, 0, 0, VanillaMaterials.STAIRS_COBBLESTONE, (short) 2);
    setBlockMaterial(4, 1, 8, VanillaMaterials.STAIRS_COBBLESTONE, (short) 2);
    setBlockMaterial(4, 2, 9, VanillaMaterials.STAIRS_COBBLESTONE, (short) 2);
    setBlockMaterial(4, 3, 10, VanillaMaterials.STAIRS_COBBLESTONE, (short) 2);
    setBlockMaterial(7, 1, 8, VanillaMaterials.STAIRS_COBBLESTONE, (short) 2);
    setBlockMaterial(7, 2, 9, VanillaMaterials.STAIRS_COBBLESTONE, (short) 2);
    setBlockMaterial(7, 3, 10, VanillaMaterials.STAIRS_COBBLESTONE, (short) 2);
    setBlockMaterial(4, 4, 5, VanillaMaterials.STAIRS_COBBLESTONE, (short) 0);
    setBlockMaterial(7, 4, 5, VanillaMaterials.STAIRS_COBBLESTONE, (short) 1);
    // Fill in some blocks for the stairs
    box.setMinMax(4, 1, 9, 4, 1, 9).fill();
    box.offsetMinMax(3, 0, 0, 3, 0, 0).fill();
    box.setMinMax(4, 1, 10, 7, 2, 10).fill();
    box.setMinMax(5, 4, 5, 6, 4, 5).fill();
    // Stair case to the basement
    box.setPicker(air);
    for (int i = 0; i < 4; i++) {
      setBlockMaterial(5, -i, 6 + i, VanillaMaterials.STAIRS_COBBLESTONE, (short) 3);
      setBlockMaterial(6, -i, 6 + i, VanillaMaterials.STAIRS_COBBLESTONE, (short) 3);
      box.setMinMax(5, -i, 7 + i, 6, -i, 9 + i).fill();
    }
    // Make some room in the basement
    box.setMinMax(1, -3, 12, 10, -1, 13).fill();
    box.offsetMinMax(0, 0, -11, -7, 0, 0).fill();
    box.offsetMinMax(0, 0, 0, 6, 0, -8).fill();
    // Decorate the ceiling of the basement
    box.setPicker(cobble);
    for (int i = 1; i <= 13; i += 2) {
      box.setMinMax(1, -3, i, 1, -2, i).fill();
    }
    for (int i = 2; i <= 12; i += 2) {
      box.setMinMax(1, -1, i, 3, -1, i).fill();
    }
    // Decoration for the back wall of the basement
    box.setMinMax(2, -2, 1, 5, -2, 1).fill();
    box.offsetMinMax(5, 0, 0, 4, 0, 0).fill();
    box.offsetMinMax(-1, -1, 0, -3, -1, 0).fill();
    box.offsetMinMax(0, 2, 0, 0, 2, 0).fill();
    // Setup a tripwire and arrow dispenser trap
    setBlockMaterial(1, -3, 8, VanillaMaterials.TRIPWIRE_HOOK, (short) 7);
    setBlockMaterial(4, -3, 8, VanillaMaterials.TRIPWIRE_HOOK, (short) 5);
    setBlockMaterial(2, -3, 8, VanillaMaterials.TRIPWIRE, (short) 4);
    setBlockMaterial(3, -3, 8, VanillaMaterials.TRIPWIRE, (short) 4);
    setBlockMaterial(5, -3, 7, VanillaMaterials.REDSTONE_WIRE);
    setBlockMaterial(5, -3, 6, VanillaMaterials.REDSTONE_WIRE);
    setBlockMaterial(5, -3, 5, VanillaMaterials.REDSTONE_WIRE);
    setBlockMaterial(5, -3, 4, VanillaMaterials.REDSTONE_WIRE);
    setBlockMaterial(5, -3, 3, VanillaMaterials.REDSTONE_WIRE);
    setBlockMaterial(5, -3, 2, VanillaMaterials.REDSTONE_WIRE);
    setBlockMaterial(5, -3, 1, VanillaMaterials.REDSTONE_WIRE);
    setBlockMaterial(4, -3, 1, VanillaMaterials.REDSTONE_WIRE);
    setBlockMaterial(3, -3, 1, VanillaMaterials.MOSS_STONE);
    setBlockMaterial(3, -2, 1, VanillaMaterials.DISPENSER, (short) 3);
    fillDispenser(3, -2, 1);
    setBlockMaterial(3, -2, 2, VanillaMaterials.VINES, (short) 15);
    // Another tripwire and arrow dispenser trap
    setBlockMaterial(7, -3, 1, VanillaMaterials.TRIPWIRE_HOOK, (short) 4);
    setBlockMaterial(7, -3, 5, VanillaMaterials.TRIPWIRE_HOOK, (short) 6);
    setBlockMaterial(7, -3, 2, VanillaMaterials.TRIPWIRE, (short) 4);
    setBlockMaterial(7, -3, 3, VanillaMaterials.TRIPWIRE, (short) 4);
    setBlockMaterial(7, -3, 4, VanillaMaterials.TRIPWIRE, (short) 4);
    setBlockMaterial(8, -3, 6, VanillaMaterials.REDSTONE_WIRE);
    setBlockMaterial(9, -3, 6, VanillaMaterials.REDSTONE_WIRE);
    setBlockMaterial(9, -3, 5, VanillaMaterials.REDSTONE_WIRE);
    setBlockMaterial(9, -3, 4, VanillaMaterials.MOSS_STONE);
    setBlockMaterial(9, -2, 4, VanillaMaterials.REDSTONE_WIRE);
    setBlockMaterial(9, -2, 3, VanillaMaterials.DISPENSER, (short) 4);
    fillDispenser(9, -2, 3);
    setBlockMaterial(8, -1, 3, VanillaMaterials.VINES, (short) 15);
    setBlockMaterial(8, -2, 3, VanillaMaterials.VINES, (short) 15);
    // Place the loot chest
    chestObject.setRandom(getRandom());
    placeObject(8, -3, 3, chestObject);
    // Setup the lever puzzle
    setBlockMaterial(9, -3, 2, VanillaMaterials.MOSS_STONE);
    setBlockMaterial(8, -3, 1, VanillaMaterials.MOSS_STONE);
    setBlockMaterial(4, -3, 5, VanillaMaterials.MOSS_STONE);
    setBlockMaterial(5, -2, 5, VanillaMaterials.MOSS_STONE);
    setBlockMaterial(5, -1, 5, VanillaMaterials.MOSS_STONE);
    setBlockMaterial(6, -3, 5, VanillaMaterials.MOSS_STONE);
    setBlockMaterial(7, -2, 5, VanillaMaterials.MOSS_STONE);
    setBlockMaterial(7, -1, 5, VanillaMaterials.MOSS_STONE);
    setBlockMaterial(8, -3, 5, VanillaMaterials.MOSS_STONE);
    box.setMinMax(9, -1, 1, 9, -1, 5).fill();
    box.setPicker(air);
    box.setMinMax(8, -3, 8, 10, -1, 10).fill();
    setBlockMaterial(8, -2, 11, VanillaMaterials.STONE_BRICK, (short) 3);
    setBlockMaterial(9, -2, 11, VanillaMaterials.STONE_BRICK, (short) 3);
    setBlockMaterial(10, -2, 11, VanillaMaterials.STONE_BRICK, (short) 3);
    setBlockMaterial(8, -2, 12, VanillaMaterials.LEVER, (short) 3);
    setBlockMaterial(9, -2, 12, VanillaMaterials.LEVER, (short) 3);
    setBlockMaterial(10, -2, 12, VanillaMaterials.LEVER, (short) 3);
    box.setPicker(cobble);
    box.setMinMax(8, -3, 8, 8, -3, 10).fill();
    box.offsetMinMax(2, 0, 0, 2, 0, 0).fill();
    setBlockMaterial(10, -2, 9, VanillaMaterials.MOSS_STONE);
    setBlockMaterial(8, -2, 9, VanillaMaterials.REDSTONE_WIRE);
    setBlockMaterial(8, -2, 10, VanillaMaterials.REDSTONE_WIRE);
    setBlockMaterial(10, -1, 9, VanillaMaterials.REDSTONE_WIRE);
    setBlockMaterial(9, -2, 8, VanillaMaterials.PISTON_STICKY_BASE, (short) 1);
View Full Code Here

    randomize();
  }

  @Override
  public boolean canPlace() {
    final PieceCuboidBuilder box = new PieceCuboidBuilder(this);
    box.setMinMax(xStart - 1, -2, -1, xEnd + 1, height, depth + 1);
    return !box.intersectsLiquids();
  }
View Full Code Here

  }

  @Override
  public void place() {
    // building objects
    final PieceCuboidBuilder box = new PieceCuboidBuilder(this);
    final SimpleBlockMaterialPicker picker = new SimpleBlockMaterialPicker();
    box.setPicker(picker);
    // basic room
    picker.setOuterInnerMaterials(VanillaMaterials.DIRT, VanillaMaterials.AIR);
    box.setMinMax(xStart, -1, 0, xEnd, height - 1, depth).toggleIgnoreAir().fill();
    box.toggleIgnoreAir();
    picker.setOuterMaterial(VanillaMaterials.AIR);
    box.setMinMax(xStart, 0, 0, xEnd, 2, depth).fill();
    // some 'decoration'
    box.setMinMax(xStart, 3, 0, xEnd, height - 1, depth).sphericalFill();
  }
View Full Code Here

  }

  @Override
  public void place() {
    // Building objects
    final PieceCuboidBuilder box = new PieceCuboidBuilder(this);
    final SimpleBlockMaterialPicker picker = new SimpleBlockMaterialPicker();
    box.setPicker(picker);
    // Floor
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    box.setMinMax(-2, 0, 0, 6, 1, 8).fill();
    // Interior space
    picker.setOuterInnerMaterials(VanillaMaterials.AIR, VanillaMaterials.AIR);
    box.offsetMinMax(0, 2, 0, 0, 4, 0).fill();
    // Roof
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    box.setMinMax(-2, 6, 0, 6, 6, 5).fill();
    // First wall
    box.setMinMax(-2, 2, 0, 0, 5, 0).fill();
    box.offsetMinMax(6, 0, 0, 6, 0, 0).fill();
    // Windows for the first wall
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK_FENCE, VanillaMaterials.NETHER_BRICK_FENCE);
    box.setMinMax(-1, 3, 0, -1, 4, 0).fill();
    box.offsetMinMax(6, 0, 0, 6, 0, 0).fill();
    // Balcony floor
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    box.setMinMax(-2, 2, 4, 6, 2, 8).fill();
    // Air spaces next to the balcony entrance
    picker.setOuterInnerMaterials(VanillaMaterials.AIR, VanillaMaterials.AIR);
    box.setMinMax(-1, 1, 4, 0, 2, 4).fill();
    box.offsetMinMax(5, 0, 0, 5, 0, 0).fill();
    // Fences for the balcony
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK_FENCE, VanillaMaterials.NETHER_BRICK_FENCE);
    box.setMinMax(-2, 3, 8, 6, 3, 8).fill();
    box.setMinMax(-2, 3, 6, -2, 3, 7).fill();
    box.offsetMinMax(8, 0, 0, 8, 0, 0).fill();
    // Wall separating the room and balcony
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    box.setMinMax(-2, 3, 4, -2, 5, 5).fill();
    box.offsetMinMax(8, 0, 0, 8, 0, 0).fill();
    box.setMinMax(-1, 3, 5, 0, 5, 5).fill();
    box.offsetMinMax(5, 0, 0, 5, 0, 0).fill();
    // Windows for that wall
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK_FENCE, VanillaMaterials.NETHER_BRICK_FENCE);
    box.setMinMax(-1, 4, 5, -1, 5, 5).fill();
    box.offsetMinMax(6, 0, 0, 6, 0, 0).fill();
    // Fill down to the ground
    for (int xx = -2; xx <= 6; xx++) {
      for (int zz = 0; zz <= 5; zz++) {
        fillDownwards(xx, -1, zz, 50, VanillaMaterials.NETHER_BRICK);
      }
View Full Code Here

    randomize();
  }

  @Override
  public boolean canPlace() {
    final PieceCuboidBuilder box = new PieceCuboidBuilder(this);
    box.setMinMax(-2, -1, -1, 4, height + 1, 5);
    return !box.intersectsLiquids();
  }
View Full Code Here

  }

  @Override
  public void place() {
    // building objects
    final PieceCuboidBuilder box = new PieceCuboidBuilder(this);
    final SimpleBlockMaterialPicker picker = new SimpleBlockMaterialPicker();
    box.setPicker(picker);
    // hollow out some space
    picker.setOuterInnerMaterials(VanillaMaterials.AIR, VanillaMaterials.AIR);
    if (hasTwoFloors()) {
      // for the extra floor
      box.setMinMax(0, 0, 0, 2, 2, 4).fill();
      box.offsetMinMax(-1, 0, 1, 1, 0, -1).fill();
      box.setMinMax(0, height - 2, 0, 2, height, 4).fill();
      box.offsetMinMax(-1, 0, 1, 1, 0, -1).fill();
      box.setMinMax(0, 3, 1, 2, 3, 3).fill();
    } else {
      box.setMinMax(0, 0, 0, 2, height, 4).fill();
      box.offsetMinMax(-1, 0, 1, 1, 0, -1).fill();
    }
    // wooden pillars
    picker.setOuterMaterial(VanillaMaterials.PLANK);
    box.setMinMax(0, 0, 1, 0, height, 1).fill();
    box.setMinMax(0, 0, 3, 0, height, 3).fill();
    box.setMinMax(2, 0, 1, 2, height, 1).fill();
    box.setMinMax(2, 0, 3, 2, height, 3).fill();
    // bridge gaps
    for (int xx = -1; xx <= 3; xx++) {
      for (int zz = 0; zz <= 4; zz++) {
        final Block block = getBlock(xx, -1, zz);
        if (block.isMaterial(VanillaMaterials.AIR)) {
View Full Code Here

  }

  @Override
  public void place() {
    // Building objects
    final PieceCuboidBuilder box = new PieceCuboidBuilder(this);
    final SimpleBlockMaterialPicker picker = new SimpleBlockMaterialPicker();
    box.setPicker(picker);
    // Floors for both bridges
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    box.setMinMax(0, 0, 0, 4, 1, 18).fill();
    box.offsetMinMax(-7, 0, 7, 7, 0, -7).fill();
    // Clear some space
    picker.setOuterInnerMaterials(VanillaMaterials.AIR, VanillaMaterials.AIR);
    box.setMinMax(1, 2, 0, 3, 4, 18).fill();
    box.offsetMinMax(-8, 0, 8, 8, 0, -8).fill();
    // Side walls for the bridges
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    box.setMinMax(0, 2, 0, 0, 2, 7).fill();
    box.offsetMinMax(0, 0, 11, 0, 0, 11).fill();
    box.offsetMinMax(4, 0, -11, 4, 0, -11).fill();
    box.offsetMinMax(0, 0, 11, 0, 0, 11).fill();
    box.offsetMinMax(-11, 0, -4, -4, 0, -11).fill();
    box.offsetMinMax(11, 0, 0, 11, 0, 0).fill();
    box.offsetMinMax(-11, 0, 4, -11, 0, 4).fill();
    box.offsetMinMax(11, 0, 0, 11, 0, 0).fill();
    // Add material under the first bridge to make an arch
    box.setMinMax(0, -1, 0, 4, -1, 5).fill();
    box.offsetMinMax(0, 0, 13, 0, 0, 13).fill();
    box.setMinMax(0, -3, 0, 4, -2, 3).fill();
    box.offsetMinMax(0, 0, 15, 0, 0, 15).fill();
    // Build the pillars of the first bridge
    for (int xx = 0; xx <= 4; xx++) {
      for (int zz = 0; zz <= 2; zz++) {
        fillDownwards(xx, -4, zz, 50, VanillaMaterials.NETHER_BRICK);
        fillDownwards(xx, -4, 18 - zz, 50, VanillaMaterials.NETHER_BRICK);
      }
    }
    // Add material under the second bridge to make an arch
    box.setMinMax(-7, -1, 7, -2, -1, 11).fill();
    box.offsetMinMax(13, 0, 0, 13, 0, 0).fill();
    box.setMinMax(-7, -3, 7, -4, -2, 11).fill();
    box.offsetMinMax(15, 0, 0, 15, 0, 0).fill();
    // Build the pillars of the second bridge
    for (int xx = -7; xx <= -5; xx++) {
      for (int zz = 7; zz <= 11; zz++) {
        fillDownwards(xx, -4, zz, 50, VanillaMaterials.NETHER_BRICK);
        fillDownwards(4 - xx, -4, zz, 50, VanillaMaterials.NETHER_BRICK);
View Full Code Here

  }

  @Override
  public void place() {
    // Building objects
    final PieceCuboidBuilder box = new PieceCuboidBuilder(this);
    final PiecePlaneBuilder plane = new PiecePlaneBuilder(this);
    final PieceLayoutBuilder painter = new PieceLayoutBuilder(this);
    final SimpleBlockMaterialPicker picker = new SimpleBlockMaterialPicker();
    box.setPicker(picker);
    plane.setPicker(picker);
    // Foundations
    picker.setOuterInnerMaterials(VanillaMaterials.SANDSTONE, VanillaMaterials.SANDSTONE);
    box.setMinMax(0, -4, 0, 20, 0, 20).fill();
    // Pyramid
    picker.setOuterInnerMaterials(VanillaMaterials.SANDSTONE, VanillaMaterials.AIR);
    plane.setMinMax(0, 0, 0, 20, 0, 20);
    for (byte yy = 1; yy < 10; yy++) {
      plane.offsetMinMax(1, 1, 1, -1, 1, -1);
      plane.fill();
    }
    // Fill the land under
    for (byte xx = 0; xx < 21; xx++) {
      for (byte zz = 0; zz < 21; zz++) {
        fillDownwards(xx, -5, zz, 50, VanillaMaterials.SANDSTONE);
      }
    }
    // Tower bodies
    picker.setOuterInnerMaterials(VanillaMaterials.SANDSTONE, VanillaMaterials.AIR);
    box.setMinMax(0, 0, 0, 4, 9, 4).fill();
    box.offsetMinMax(16, 0, 0, 16, 0, 0).fill();
    picker.setInnerMaterial(VanillaMaterials.SANDSTONE);
    box.setMinMax(1, 10, 1, 3, 10, 3).fill();
    box.offsetMinMax(16, 0, 0, 16, 0, 0).fill();
    setBlockMaterial(2, 10, 0, VanillaMaterials.STAIRS_SANDSTONE, (short) 2);
    setBlockMaterial(2, 10, 4, VanillaMaterials.STAIRS_SANDSTONE, (short) 3);
    setBlockMaterial(0, 10, 2, VanillaMaterials.STAIRS_SANDSTONE, (short) 0);
    setBlockMaterial(4, 10, 2, VanillaMaterials.STAIRS_SANDSTONE, (short) 1);
    setBlockMaterial(18, 10, 0, VanillaMaterials.STAIRS_SANDSTONE, (short) 2);
    setBlockMaterial(18, 10, 4, VanillaMaterials.STAIRS_SANDSTONE, (short) 3);
    setBlockMaterial(16, 10, 2, VanillaMaterials.STAIRS_SANDSTONE, (short) 0);
    setBlockMaterial(20, 10, 2, VanillaMaterials.STAIRS_SANDSTONE, (short) 1);
    // Entry way
    picker.setOuterInnerMaterials(VanillaMaterials.SANDSTONE, VanillaMaterials.AIR);
    box.setMinMax(8, 0, 0, 12, 4, 4).fill();
    picker.setOuterMaterial(VanillaMaterials.AIR);
    box.offsetMinMax(1, 1, 0, -1, -1, 0).fill();
    setBlockMaterial(9, 1, 1, Sandstone.SMOOTH);
    setBlockMaterial(9, 2, 1, Sandstone.SMOOTH);
    setBlockMaterial(9, 3, 1, Sandstone.SMOOTH);
    setBlockMaterial(10, 3, 1, Sandstone.SMOOTH);
    setBlockMaterial(11, 3, 1, Sandstone.SMOOTH);
    setBlockMaterial(11, 2, 1, Sandstone.SMOOTH);
    setBlockMaterial(11, 1, 1, Sandstone.SMOOTH);
    // Passage ways to the towers
    picker.setOuterInnerMaterials(VanillaMaterials.SANDSTONE, VanillaMaterials.AIR);
    box.setMinMax(4, 1, 1, 8, 3, 3).fill();
    picker.setOuterMaterial(VanillaMaterials.AIR);
    box.offsetMinMax(0, 0, 1, 0, -1, -1).fill();
    picker.setOuterInnerMaterials(VanillaMaterials.SANDSTONE, VanillaMaterials.AIR);
    box.setMinMax(12, 1, 1, 16, 3, 3).fill();
    picker.setOuterMaterial(VanillaMaterials.AIR);
    box.offsetMinMax(0, 0, 1, 0, -1, -1).fill();
    // Second floor
    picker.setOuterInnerMaterials(VanillaMaterials.SANDSTONE, VanillaMaterials.SANDSTONE);
    box.setMinMax(5, 4, 5, 15, 4, 15).fill();
    picker.setOuterInnerMaterials(VanillaMaterials.AIR, VanillaMaterials.AIR);
    box.offsetMinMax(4, 0, 4, -4, 0, -4).fill();
    // Columns on the first floor
    picker.setOuterInnerMaterials(Sandstone.SMOOTH, Sandstone.SMOOTH);
    box.setMinMax(8, 1, 8, 8, 3, 8).fill();
    box.offsetMinMax(4, 0, 0, 4, 0, 0).fill();
    box.offsetMinMax(-4, 0, 4, -4, 0, 4).fill();
    box.offsetMinMax(4, 0, 0, 4, 0, 0).fill();
    // Side passage ways to the pyramid on the second floor
    picker.setOuterInnerMaterials(VanillaMaterials.SANDSTONE, VanillaMaterials.SANDSTONE);
    box.setMinMax(1, 1, 5, 4, 4, 11).fill();
    box.offsetMinMax(15, 0, 0, 15, 0, 0).fill();
    // The door ways for the passages mentioned above
    box.setMinMax(6, 7, 9, 6, 7, 11).fill();
    box.offsetMinMax(8, 0, 0, 8, 0, 0).fill();
    picker.setOuterInnerMaterials(Sandstone.SMOOTH, Sandstone.SMOOTH);
    box.setMinMax(5, 5, 9, 5, 7, 11).fill();
    box.offsetMinMax(10, 0, 0, 10, 0, 0).fill();
    picker.setOuterInnerMaterials(VanillaMaterials.AIR, VanillaMaterials.AIR);
    box.setMinMax(5, 5, 10, 6, 6, 10).fill();
    box.offsetMinMax(9, 0, 0, 9, 0, 0).fill();
    // Side entry ways to the towers on the second floor
    box.setMinMax(2, 4, 4, 2, 6, 4).fill();
    box.offsetMinMax(16, 0, 0, 16, 0, 0).fill();
    // The staircases for the towers
    setBlockMaterial(2, 4, 5, VanillaMaterials.STAIRS_SANDSTONE, (short) 2);
    setBlockMaterial(2, 3, 4, VanillaMaterials.STAIRS_SANDSTONE, (short) 2);
    setBlockMaterial(18, 4, 5, VanillaMaterials.STAIRS_SANDSTONE, (short) 2);
    setBlockMaterial(18, 3, 4, VanillaMaterials.STAIRS_SANDSTONE, (short) 2);
    picker.setOuterInnerMaterials(VanillaMaterials.SANDSTONE, VanillaMaterials.SANDSTONE);
    box.setMinMax(1, 1, 3, 2, 2, 3).fill();
    box.offsetMinMax(17, 0, 0, 17, 0, 0).fill();
    setBlockMaterial(1, 1, 2, VanillaMaterials.STAIRS_SANDSTONE, (short) 0);
    setBlockMaterial(19, 1, 2, VanillaMaterials.STAIRS_SANDSTONE, (short) 0);
    setBlockMaterial(1, 2, 2, Slab.SANDSTONE);
    setBlockMaterial(19, 2, 2, Slab.SANDSTONE);
    setBlockMaterial(2, 1, 2, VanillaMaterials.STAIRS_SANDSTONE, (short) 1);
    setBlockMaterial(18, 1, 2, VanillaMaterials.STAIRS_SANDSTONE, (short) 0);
    // Setup the spaces for the rows of columns inside
    box.setMinMax(4, 3, 5, 4, 3, 17).fill();
    box.offsetMinMax(12, 0, 0, 12, 0, 0).fill();
    picker.setOuterInnerMaterials(VanillaMaterials.AIR, VanillaMaterials.AIR);
    box.setMinMax(3, 1, 5, 4, 2, 16).fill();
    box.offsetMinMax(13, 0, 0, 13, 0, 0).fill();
    // Now place the columns
    for (int zz = 5; zz < 18; zz += 2) {
      setBlockMaterial(4, 1, zz, Sandstone.SMOOTH);
      setBlockMaterial(4, 2, zz, Sandstone.DECORATIVE);
      setBlockMaterial(16, 1, zz, Sandstone.SMOOTH);
      setBlockMaterial(16, 2, zz, Sandstone.DECORATIVE);
    }
    // Apply the center cross above the loot pit, in the center of the pyramid
    painter.setLayout(CENTER_CROSS).setPosition(7, 0, 7).fill();
    // Apply the glyphs on the towers
    painter.setLayout(TOWER).setPosition(1, 8, 0).setRotation(Quaternionf.fromAngleDegAxis(90, 1, 0, 0)).fill();
    painter.offsetPosition(16, 0, 0).fill();
    // Apply the glyph on the main door
    painter.setLayout(DOOR).setPosition(8, 6, 0).fill();
    // Dig the loot pit
    picker.setOuterInnerMaterials(Sandstone.SMOOTH, Sandstone.SMOOTH);
    box.setMinMax(8, -14, 8, 12, -11, 12).fill();
    picker.setOuterInnerMaterials(Sandstone.DECORATIVE, Sandstone.DECORATIVE);
    box.offsetMinMax(0, 4, 0, 0, 1, 0).fill();
    picker.setOuterInnerMaterials(Sandstone.SMOOTH, Sandstone.SMOOTH);
    box.offsetMinMax(0, 1, 0, 0, 1, 0).fill();
    picker.setOuterInnerMaterials(VanillaMaterials.SANDSTONE, VanillaMaterials.SANDSTONE);
    box.setMinMax(8, -8, 8, 12, -1, 12).fill();
    picker.setOuterInnerMaterials(VanillaMaterials.AIR, VanillaMaterials.AIR);
    box.offsetMinMax(1, -3, 1, -1, 0, -1).fill();
    // It's a trap! (TNT bellow the floor and stone pressure plate in the middle)
    setBlockMaterial(10, -11, 10, VanillaMaterials.STONE_PRESSURE_PLATE);
    picker.setOuterInnerMaterials(VanillaMaterials.TNT, VanillaMaterials.TNT);
    box.setMinMax(9, -13, 9, 11, -13, 11).fill();
    // Setup the chest spaces
    picker.setOuterInnerMaterials(VanillaMaterials.AIR, VanillaMaterials.AIR);
    box.setMinMax(8, -11, 10, 8, -10, 10).fill();
    setBlockMaterial(7, -10, 10, Sandstone.DECORATIVE);
    setBlockMaterial(7, -11, 10, Sandstone.SMOOTH);
    box.offsetMinMax(4, 0, 0, 4, 0, 0).fill();
    setBlockMaterial(13, -10, 10, Sandstone.DECORATIVE);
    setBlockMaterial(13, -11, 10, Sandstone.SMOOTH);
    box.offsetMinMax(-2, 0, -2, -2, 0, -2).fill();
    setBlockMaterial(10, -10, 7, Sandstone.DECORATIVE);
    setBlockMaterial(10, -11, 7, Sandstone.SMOOTH);
    box.offsetMinMax(0, 0, 4, 0, 0, 4).fill();
    setBlockMaterial(10, -10, 13, Sandstone.DECORATIVE);
    setBlockMaterial(10, -11, 13, Sandstone.SMOOTH);
    // Place the loot chests
    chestObject.setRandom(getRandom());
    for (BlockFace face : BlockFaces.NSEW) {
View Full Code Here

  }

  @Override
  public void place() {
    // Building objects
    final PieceCuboidBuilder box = new PieceCuboidBuilder(this);
    // General shape
    box.setPicker(new StrongholdBlockMaterialPicker(getRandom()));
    box.setMinMax(0, 0, 0, 4, 4, 4).toggleIgnoreAir().fill();
    box.toggleIgnoreAir();
    // Place the door
    StrongholdDoor.getRandomDoor(this, getRandom()).place(1, 1, 0);
    // Place the access way depending on the direction
    box.setPicker(new SimpleBlockMaterialPicker());
    if (left) {
      box.setMinMax(4, 1, 1, 4, 3, 3).fill();
    } else {
      box.setMinMax(0, 1, 1, 0, 3, 3).fill();
    }
  }
View Full Code Here

TOP

Related Classes of org.spout.vanilla.world.generator.structure.PieceCuboidBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.