Examples of PieceCuboidBuilder


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);
    // Built section by section
    for (int zz = 0; zz <= 9; zz++) {
      // Starting and ending yy for the section
      final int syy = Math.max(1, 7 - zz) - 7;
      final int eyy = GenericMath.clamp(syy + 5, 14 - zz, 13) - 7;
      // Basic outline
      picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
      box.setMinMax(0, -7, zz, 4, syy, zz).fill();
      picker.setOuterInnerMaterials(VanillaMaterials.AIR, VanillaMaterials.AIR);
      box.setMinMax(1, syy + 1, zz, 3, eyy - 1, zz).fill();
      // Add some stairs
      if (zz <= 6) {
        setBlockMaterial(1, syy + 1, zz, VanillaMaterials.STAIRS_NETHER_BRICK, (short) 3);
        setBlockMaterial(2, syy + 1, zz, VanillaMaterials.STAIRS_NETHER_BRICK, (short) 3);
        setBlockMaterial(3, syy + 1, zz, VanillaMaterials.STAIRS_NETHER_BRICK, (short) 3);
      }
      // Precise outline for the section
      picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
      box.setMinMax(0, eyy, zz, 4, eyy, zz).fill();
      box.setMinMax(0, syy + 1, zz, 0, eyy - 1, zz).fill();
      box.offsetMinMax(4, 0, 0, 4, 0, 0).fill();
      // Windows on the right and left with odd spacing
      if (zz % 2 != 0) {
        picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK_FENCE, VanillaMaterials.NETHER_BRICK_FENCE);
        box.setMinMax(0, syy + 2, zz, 0, syy + 3, zz).fill();
        box.offsetMinMax(4, 0, 0, 4, 0, 0).fill();
      }
      // Fill down to the ground
      for (int xx = 0; xx <= 4; xx++) {
        fillDownwards(xx, -8, zz, 50, VanillaMaterials.NETHER_BRICK);
      }
View Full Code Here

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(0, 0, 0, 4, 1, 4).fill();
    // Interior space
    picker.setOuterInnerMaterials(VanillaMaterials.AIR, VanillaMaterials.AIR);
    box.offsetMinMax(0, 2, 0, 0, 4, 0).fill();
    // Right and left walls
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    box.offsetMinMax(0, 0, 0, -4, 0, 0).fill();
    box.offsetMinMax(4, 0, 0, 4, 0, 0).fill();
    // Windows for both walls
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK_FENCE, VanillaMaterials.NETHER_BRICK_FENCE);
    box.setMinMax(0, 3, 1, 0, 4, 1).fill();
    box.offsetMinMax(0, 0, 2, 0, 0, 2).fill();
    box.setMinMax(4, 3, 1, 4, 4, 1).fill();
    box.offsetMinMax(0, 0, 2, 0, 0, 2).fill();
    // Roof
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    box.setMinMax(0, 6, 0, 4, 6, 4).fill();
    // Fill down to the ground
    for (int xx = 0; xx <= 4; xx++) {
      for (int zz = 0; zz <= 4; zz++) {
        fillDownwards(xx, -1, zz, 50, VanillaMaterials.NETHER_BRICK);
      }
View Full Code Here

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(0, 0, 0, 4, 1, 18).fill();
    // Clear some space
    picker.setOuterInnerMaterials(VanillaMaterials.AIR, VanillaMaterials.AIR);
    box.setMinMax(1, 2, 0, 3, 4, 18).fill();
    // Side walls
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    box.setMinMax(0, 2, 0, 0, 2, 18).fill();
    box.offsetMinMax(4, 0, 0, 4, 0, 0).fill();
    // Add material under the 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 on the both ends downwards
    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);
      }
    }
    // Decoration fences on the side of the bridge
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK_FENCE, VanillaMaterials.NETHER_BRICK_FENCE);
    box.setMinMax(0, 0, 4, 0, 1, 4).fill();
    box.offsetMinMax(0, 0, 10, 0, 0, 10).fill();
    box.setMinMax(4, 0, 4, 4, 1, 4).fill();
    box.offsetMinMax(0, 0, 10, 0, 0, 10).fill();
    box.setMinMax(0, -2, 1, 0, 1, 1).fill();
    box.offsetMinMax(0, 0, 16, 0, 0, 16).fill();
    box.setMinMax(4, -2, 1, 4, 1, 1).fill();
    box.offsetMinMax(0, 0, 16, 0, 0, 16).fill();
  }
View Full Code Here

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(-4, 0, 0, 8, 1, 12).fill();
    // Interior space
    picker.setOuterInnerMaterials(VanillaMaterials.AIR, VanillaMaterials.AIR);
    box.offsetMinMax(0, 2, 0, 0, 9, 0).fill();
    // The too walls without entrances
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    box.setMinMax(-4, 2, 0, -3, 9, 12).fill();
    box.offsetMinMax(11, 0, 0, 11, 0, 0).fill();
    box.setMinMax(-2, 2, 11, 0, 9, 12).fill();
    box.offsetMinMax(6, 0, 0, 6, 0, 0).fill();
    // The two other walls
    box.setMinMax(1, 6, 0, 3, 9, 1).fill();
    box.offsetMinMax(0, 0, 11, 0, 0, 11).fill();
    box.setMinMax(-2, 2, 0, 0, 9, 1).fill();
    box.offsetMinMax(6, 0, 0, 6, 0, 0).fill();
    // Roof
    box.setMinMax(-2, 8, 2, 6, 9, 10).fill();
    // Decorate the outside
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK_FENCE, VanillaMaterials.NETHER_BRICK_FENCE);
    for (int xxzz = 1; xxzz <= 11; xxzz += 2) {
      // Fences on the outside walls
      box.setMinMax(xxzz - 4, 7, 0, xxzz - 4, 8, 0).fill();
      box.offsetMinMax(0, 0, 12, 0, 0, 12).fill();
      box.setMinMax(-4, 7, xxzz, -4, 8, xxzz).fill();
      box.offsetMinMax(12, 0, 0, 12, 0, 0).fill();
      // Fences and brick on the roof
      setBlockMaterial(xxzz - 4, 10, 0, VanillaMaterials.NETHER_BRICK);
      setBlockMaterial(xxzz - 4, 10, 12, VanillaMaterials.NETHER_BRICK);
      setBlockMaterial(-4, 10, xxzz, VanillaMaterials.NETHER_BRICK);
      setBlockMaterial(8, 10, xxzz, VanillaMaterials.NETHER_BRICK);
      setBlockMaterial(xxzz - 3, 10, 0, VanillaMaterials.NETHER_BRICK_FENCE);
      setBlockMaterial(xxzz - 3, 10, 12, VanillaMaterials.NETHER_BRICK_FENCE);
      setBlockMaterial(-4, 10, xxzz + 1, VanillaMaterials.NETHER_BRICK_FENCE);
      setBlockMaterial(8, 10, xxzz + 1, VanillaMaterials.NETHER_BRICK_FENCE);
    }
    // Corner fences for the roof
    setBlockMaterial(-4, 10, 0, VanillaMaterials.NETHER_BRICK_FENCE);
    setBlockMaterial(-4, 10, 12, VanillaMaterials.NETHER_BRICK_FENCE);
    setBlockMaterial(-4, 10, 0, VanillaMaterials.NETHER_BRICK_FENCE);
    setBlockMaterial(8, 10, 0, VanillaMaterials.NETHER_BRICK_FENCE);
    // Fences on the inside
    for (int zz = 3; zz <= 9; zz += 2) {
      box.setMinMax(-3, 4, zz, -3, 5, zz).fill();
      box.offsetMinMax(10, 0, 0, 10, 0, 0).fill();
    }
    // Generate the staircase to the roof
    for (int yy = -3; yy <= 3; yy++) {
      final int zz = yy + 7;
      for (int xx = 1; xx <= 3; xx++) {
        setBlockMaterial(xx, yy + 5, zz, VanillaMaterials.STAIRS_NETHER_BRICK, (short) 2);
      }
      picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
      if (zz >= 5) {
        if (zz <= 8) {
          box.setMinMax(1, 2, zz, 3, yy + 4, zz).fill();
        } else {
          box.setMinMax(1, 5, zz, 3, yy + 4, zz).fill();
        }
      }
      picker.setOuterInnerMaterials(VanillaMaterials.AIR, VanillaMaterials.AIR);
      if (yy >= -2) {
        box.setMinMax(1, yy + 6, zz, 3, yy + 9, zz).fill();
      }
    }
    for (int xx = 1; xx <= 3; xx++) {
      setBlockMaterial(xx, 9, 11, VanillaMaterials.STAIRS_NETHER_BRICK, (short) 2);
    }
    // Fences in the sides of the staircase
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK_FENCE, VanillaMaterials.NETHER_BRICK_FENCE);
    box.setMinMax(1, 3, 7, 1, 4, 7).fill();
    box.offsetMinMax(2, 0, 0, 2, 0, 0).fill();
    // Remove part of the fence on the roof to make an entrance
    picker.setOuterInnerMaterials(VanillaMaterials.AIR, VanillaMaterials.AIR);
    box.setMinMax(1, 10, 12, 3, 10, 12).fill();
    // Passage ways through the room with stairs on both ends
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    box.setMinMax(-2, 2, 2, -1, 2, 3).fill();
    box.offsetMinMax(0, 0, 7, 0, 0, 7).fill();
    box.setMinMax(-2, 2, 4, -2, 2, 8).fill();
    box.setMinMax(5, 2, 2, 6, 2, 3).fill();
    box.offsetMinMax(0, 0, 7, 0, 0, 7).fill();
    box.setMinMax(6, 2, 4, 6, 2, 8).fill();
    setBlockMaterial(0, 2, 2, VanillaMaterials.STAIRS_NETHER_BRICK, (short) 1);
    setBlockMaterial(0, 2, 3, VanillaMaterials.STAIRS_NETHER_BRICK, (short) 1);
    setBlockMaterial(0, 2, 9, VanillaMaterials.STAIRS_NETHER_BRICK, (short) 1);
    setBlockMaterial(0, 2, 10, VanillaMaterials.STAIRS_NETHER_BRICK, (short) 1);
    setBlockMaterial(4, 2, 2, VanillaMaterials.STAIRS_NETHER_BRICK, (short) 0);
    setBlockMaterial(4, 2, 3, VanillaMaterials.STAIRS_NETHER_BRICK, (short) 0);
    setBlockMaterial(4, 2, 9, VanillaMaterials.STAIRS_NETHER_BRICK, (short) 0);
    setBlockMaterial(4, 2, 10, VanillaMaterials.STAIRS_NETHER_BRICK, (short) 0);
    // Nether wart around the stairs
    picker.setOuterInnerMaterials(VanillaMaterials.SOUL_SAND, VanillaMaterials.SOUL_SAND);
    box.setMinMax(-1, 1, 4, 0, 1, 8).fill();
    box.offsetMinMax(5, 0, 0, 5, 0, 0).fill();
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_WART_BLOCK, VanillaMaterials.NETHER_WART_BLOCK);
    box.setMinMax(-1, 2, 4, 0, 2, 8).fill();
    box.offsetMinMax(5, 0, 0, 5, 0, 0).fill();
    // Material just above the pillar to create some arch shape
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    box.setMinMax(0, -1, 0, 4, -1, 12).fill();
    box.offsetMinMax(-4, 0, 4, 4, 0, -4).fill();
    box.setMinMax(0, -3, 0, 4, -2, 3).fill();
    box.offsetMinMax(0, 0, 9, 0, 0, 9).fill();
    box.setMinMax(-4, -3, 4, -1, -2, 8).fill();
    box.offsetMinMax(9, 0, 0, 9, 0, 0).fill();
    // Build the four pillars down to the gound
    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, 12 - zz, 50, VanillaMaterials.NETHER_BRICK);
View Full Code Here

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(0, 0, 0, 4, 1, 4).fill();
    // Interior space
    picker.setOuterInnerMaterials(VanillaMaterials.AIR, VanillaMaterials.AIR);
    box.offsetMinMax(0, 2, 0, 0, 4, 0).fill();
    // Four corner columns
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    box.offsetMinMax(0, 0, 0, -4, 0, -4).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();
    // Roof
    box.setMinMax(0, 6, 0, 4, 6, 4).fill();
    // Fill down to the ground
    for (int xx = 0; xx <= 4; xx++) {
      for (int zz = 0; zz <= 4; zz++) {
        fillDownwards(xx, -1, zz, 50, VanillaMaterials.NETHER_BRICK);
      }
View Full Code Here

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

        .addMaterial(VanillaMaterials.PUMPKIN_SEEDS, 10, 2, 4);
  }

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

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

    // rng
    final Random random = getRandom();
    // properties
    final short lenght = (short) (sections * 5 - 1);
    // building objects
    final PieceCuboidBuilder box = new PieceCuboidBuilder(this);
    final SimpleBlockMaterialPicker picker = new SimpleBlockMaterialPicker();
    box.setPicker(picker);
    // the basic tunnel
    picker.setOuterInnerMaterials(VanillaMaterials.AIR, VanillaMaterials.AIR);
    box.setMinMax(0, 0, 0, 2, 1, lenght).fill();
    box.offsetMinMax(0, 2, 0, 0, 1, 0).randomFill(0.8f);
    // spider webs for spawner
    if (caveSpiders) {
      picker.setOuterMaterial(VanillaMaterials.WEB);
      box.setMinMax(0, 0, 0, 2, 1, lenght).randomFill(0.6f);
    }
    // decorate sections
    for (byte section = 0; section < sections; section++) {
      final short sectionZ = (short) (section * 5 + 2);
      // fences
      picker.setOuterMaterial(VanillaMaterials.WOODEN_FENCE);
      box.setMinMax(0, 0, sectionZ, 0, 1, sectionZ).fill();
      box.offsetMinMax(2, 0, 0, 2, 0, 0).fill();
      // ceiling planks
      picker.setOuterMaterial(VanillaMaterials.PLANK);
      if (random.nextInt(4) != 0) {
        box.setMinMax(0, 2, sectionZ, 2, 2, sectionZ).fill();
      } else {
        box.setMinMax(0, 2, sectionZ, 0, 2, sectionZ).fill();
        box.offsetMinMax(2, 0, 0, 2, 0, 0).fill();
      }
      // webs and torches
      setBlockMaterial(0.9f, 0, 2, sectionZ - 1, VanillaMaterials.WEB);
      setBlockMaterial(0.9f, 2, 2, sectionZ - 1, VanillaMaterials.WEB);
      setBlockMaterial(0.9f, 0, 2, sectionZ + 1, VanillaMaterials.WEB);
View Full Code Here

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(0, 0, 0, 4, 1, 4).fill();
    // Interior space
    picker.setOuterInnerMaterials(VanillaMaterials.AIR, VanillaMaterials.AIR);
    box.offsetMinMax(0, 2, 0, 0, 4, 0).fill();
    // First wall
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    if (left) {
      box.offsetMinMax(0, 0, 0, -4, 0, 0);
    } else {
      box.offsetMinMax(4, 0, 0, 0, 0, 0);
    }
    box.fill();
    // Windows for the first wall
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK_FENCE, VanillaMaterials.NETHER_BRICK_FENCE);
    if (left) {
      box.setMinMax(0, 3, 1, 0, 4, 1);
    } else {
      box.setMinMax(4, 3, 1, 4, 4, 1);
    }
    box.fill();
    box.offsetMinMax(0, 0, 2, 0, 0, 2).fill();
    // Second wall
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    if (left) {
      box.setMinMax(4, 2, 0, 4, 5, 0).fill();
      box.offsetMinMax(-3, 0, 4, 0, 0, 4).fill();
    } else {
      box.setMinMax(0, 2, 0, 0, 5, 0).fill();
      box.offsetMinMax(0, 0, 4, 3, 0, 4).fill();
    }
    // Windows for the second wall
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK_FENCE, VanillaMaterials.NETHER_BRICK_FENCE);
    box.setMinMax(1, 3, 4, 1, 4, 4).fill();
    box.offsetMinMax(2, 0, 0, 2, 0, 0).fill();
    // Roof
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    box.setMinMax(0, 6, 0, 4, 6, 4).fill();
    // Fill down to the ground
    for (int xx = 0; xx <= 4; xx++) {
      for (int zz = 0; zz <= 4; zz++) {
        fillDownwards(xx, -1, zz, 50, VanillaMaterials.NETHER_BRICK);
      }
View Full Code Here

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

    super(parent, DEFAULT_NEXT);
  }

  @Override
  public boolean canPlace() {
    final PieceCuboidBuilder box = new PieceCuboidBuilder(this);
    box.setMinMax(-1, -6, -1, 3, 3, 9);
    return !box.intersectsLiquids();
  }
View Full Code Here

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);
    // case
    picker.setOuterInnerMaterials(VanillaMaterials.AIR, VanillaMaterials.AIR);
    box.setMinMax(0, 0, 0, 2, 2, 1).fill();
    box.setMinMax(0, -5, 7, 2, -3, 8).fill();
    // steps
    for (byte steps = 0; steps < 5; steps++) {
      box.setMinMax(0, -steps - (steps >= 4 ? 0 : 1), 2 + steps, 2, 2 - steps, 2 + steps).fill();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.