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

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


  @Override
  public void place() {
    // Building objects
    final PieceCuboidBuilder box = new PieceCuboidBuilder(this);
    final SimpleBlockMaterialPicker picker = new SimpleBlockMaterialPicker();
    box.setPicker(picker);
    final Random random = getRandom();
    // Partially built higher part of the bridge
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    for (int xx = 0; xx <= 4; xx++) {
      for (int yy = 0; yy <= 1; yy++) {
        box.setMinMax(xx, yy, 0, xx, yy, random.nextInt(8)).fill();
      }
    }
View Full Code Here


  @Override
  public void place() {
    // Building objects
    final PieceCuboidBuilder box = new PieceCuboidBuilder(this);
    final SimpleBlockMaterialPicker picker = new SimpleBlockMaterialPicker();
    final StrongholdBlockMaterialPicker stone = new StrongholdBlockMaterialPicker(getRandom());
    // General shape
    box.setPicker(stone);
    box.setMinMax(-3, -2, 0, 6, 6, 10).toggleIgnoreAir().fill();
    box.toggleIgnoreAir();
    // Place the door
    StrongholdDoor.getRandomDoor(this, getRandom()).place(1, 1, 0);
    // Access to the next components of the intersection
    box.setPicker(picker);
    if (nextComponentRightLow) {
      box.setMinMax(-3, 1, 1, -3, 3, 3).fill();
    }
    if (nextComponentRightHigh) {
      box.setMinMax(-3, 3, 7, -3, 5, 9).fill();
    }
    if (nextComponentLeftLow) {
      box.setMinMax(6, 1, 1, 6, 3, 3).fill();
    }
    if (nextComponentLeftHigh) {
      box.setMinMax(6, 3, 7, 6, 5, 9).fill();
    }
    // The bottom access way
    box.setMinMax(2, -1, 10, 4, 1, 10).fill();
    // Finish the interior
    box.setPicker(stone);
    box.setMinMax(-2, 0, 1, 5, 0, 6).fill();
    box.setMinMax(1, -1, 5, 1, 2, 9).fill();
    box.offsetMinMax(4, 0, 0, 4, 0, 0).fill();
    box.setMinMax(-2, 2, 7, 0, 2, 9).fill();
    box.setMinMax(-2, 1, 5, 0, 1, 6).fill();
    picker.setOuterInnerMaterials(VanillaMaterials.SLAB, VanillaMaterials.SLAB);
    box.setPicker(picker);
    box.setMinMax(-2, 1, 4, 0, 1, 4).fill();
    box.offsetMinMax(0, 1, 2, 0, 1, 2).fill();
    box.setPicker(stone);
    box.setMinMax(2, -1, 7, 4, -1, 8).fill();
View Full Code Here

  @Override
  public void place() {
    // Building objects
    final PieceCuboidBuilder box = new PieceCuboidBuilder(this);
    final SimpleBlockMaterialPicker picker = new SimpleBlockMaterialPicker();
    box.setPicker(picker);
    // Clear some space
    picker.setOuterInnerMaterials(VanillaMaterials.AIR, VanillaMaterials.AIR);
    box.setMinMax(-1, 2, 0, 5, 7, 7).fill();
    // Base of the balcony
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    box.setMinMax(0, 0, 0, 4, 1, 7).fill();
    // Stairs to the balcony
    box.setMinMax(0, 2, 1, 4, 2, 7).fill();
    box.offsetMinMax(0, 1, 1, 0, 1, 0).fill();
    box.offsetMinMax(0, 1, 1, 0, 1, 0).fill();
    // Walls on the sides of the stairs
    box.setMinMax(0, 2, 0, 0, 4, 2).fill();
    box.offsetMinMax(4, 0, 0, 4, 0, 0).fill();
    box.setMinMax(0, 5, 2, 0, 5, 3).fill();
    box.offsetMinMax(4, 0, 0, 4, 0, 0).fill();
    // Side walls of the balcony
    box.setMinMax(-1, 5, 3, -1, 5, 8).fill();
    box.offsetMinMax(6, 0, 0, 6, 0, 0).fill();
    box.setMinMax(0, 5, 8, 4, 5, 8).fill();
    // Fences above the side walls of the balcony
    setBlockMaterial(0, 6, 3, VanillaMaterials.NETHER_BRICK_FENCE);
    setBlockMaterial(4, 6, 3, VanillaMaterials.NETHER_BRICK_FENCE);
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK_FENCE, VanillaMaterials.NETHER_BRICK_FENCE);
    box.setMinMax(-1, 6, 3, -1, 6, 8).fill();
    box.offsetMinMax(6, 0, 0, 6, 0, 0).fill();
    box.setMinMax(0, 6, 8, 4, 7, 8).fill();
    box.setMinMax(1, 8, 8, -3, 8, 8).fill();
    setBlockMaterial(2, 5, 5, VanillaMaterials.MONSTER_SPAWNER);
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(-1, 0, 0, 5, 1, 6).fill();
    // Interior space
    picker.setOuterInnerMaterials(VanillaMaterials.AIR, VanillaMaterials.AIR);
    box.offsetMinMax(0, 2, 0, 0, 9, 0).fill();
    // Walls
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    box.setMinMax(-1, 2, 0, 0, 8, 0).fill();
    box.offsetMinMax(5, 0, 0, 5, 0, 0).fill();
    box.setMinMax(-1, 2, 1, -1, 8, 6).fill();
    box.offsetMinMax(6, 0, 0, 6, 0, 0).fill();
    box.setMinMax(0, 2, 6, 4, 8, 6).fill();
    // Windows
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK_FENCE, VanillaMaterials.NETHER_BRICK_FENCE);
    box.setMinMax(-1, 3, 2, -1, 5, 4).fill();
    box.offsetMinMax(6, 0, 0, 6, 0, -2).fill();
    box.offsetMinMax(0, 0, 2, 0, 0, 2).fill();
    // Stairs to the roof
    setBlockMaterial(4, 2, 5, VanillaMaterials.NETHER_BRICK);
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    box.setMinMax(3, 2, 5, 3, 3, 5).fill();
    box.offsetMinMax(-1, 0, 0, -1, 1, 0).fill();
    box.offsetMinMax(-1, 0, 0, -1, 1, 0).fill();
    box.offsetMinMax(-1, 0, 0, -1, 1, 0).fill();
    // Roof
    box.setMinMax(0, 7, 1, 4, 7, 4).fill();
    // Remove part of the side wall on the roof to make an entrance
    picker.setOuterInnerMaterials(VanillaMaterials.AIR, VanillaMaterials.AIR);
    box.setMinMax(5, 8, 2, 5, 8, 4).fill();
    // Material above the lower entrance to make shorter
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK, VanillaMaterials.NETHER_BRICK);
    box.setMinMax(1, 6, 0, 3, 8, 0).fill();
    // Fences above the lower entrance to make a gateway
    picker.setOuterInnerMaterials(VanillaMaterials.NETHER_BRICK_FENCE, VanillaMaterials.NETHER_BRICK_FENCE);
    box.setMinMax(1, 5, 0, 3, 5, 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 picker = new SimpleBlockMaterialPicker();
    final StrongholdBlockMaterialPicker stone = new StrongholdBlockMaterialPicker(getRandom());
    // General shape
    box.setPicker(stone);
    box.setMinMax(0, 0, 0, 8, 4, 10).toggleIgnoreAir().fill();
    box.toggleIgnoreAir();
    // Place the door
    StrongholdDoor.getRandomDoor(this, getRandom()).place(1, 1, 0);
    // Make some room
    box.setPicker(picker);
    box.setMinMax(1, 1, 10, 3, 3, 10).fill();
    // Cell walls
    box.setPicker(stone);
    box.setMinMax(4, 1, 1, 4, 3, 1).fill();
    box.offsetMinMax(0, 0, 2, 0, 0, 2).fill();
    box.offsetMinMax(0, 0, 4, 0, 0, 4).fill();
    box.offsetMinMax(0, 0, 2, 0, 0, 2).fill();
    // Build the cells
    box.setPicker(picker);
    picker.setOuterInnerMaterials(VanillaMaterials.IRON_BARS, VanillaMaterials.IRON_BARS);
    box.setMinMax(4, 1, 4, 4, 3, 6).fill();
    box.setMinMax(5, 1, 5, 7, 3, 5).fill();
    setBlockMaterial(4, 3, 2, VanillaMaterials.IRON_BARS);
    setBlockMaterial(4, 3, 8, VanillaMaterials.IRON_BARS);
    // Add the cell doors
View Full Code Here

    }

    @Override
    public void place(int xx, int yy, int zz) {
      final PieceCuboidBuilder box = new PieceCuboidBuilder(parent);
      box.setPicker(new SimpleBlockMaterialPicker());
      box.setMinMax(xx, yy, zz, xx + 2, yy + 2, zz).fill();
    }
View Full Code Here

    attachMaterial(0.1f, 1, 2, 1, VanillaMaterials.TORCH);
    attachMaterial(0.1f, 3, 2, 1, VanillaMaterials.TORCH);
    attachMaterial(0.1f, 1, 2, 5, VanillaMaterials.TORCH);
    attachMaterial(0.1f, 3, 2, 5, VanillaMaterials.TORCH);
    // Access for the next components
    box.setPicker(new SimpleBlockMaterialPicker());
    if (nextComponentRight) {
      box.setMinMax(0, 1, 2, 0, 3, 4).fill();
    }
    if (nextComponentLeft) {
      box.setMinMax(4, 1, 2, 4, 3, 4).fill();
View Full Code Here

    box.setMinMax(-3, 0, 0, 10, height - 1, 14).toggleIgnoreAir().fill();
    box.toggleIgnoreAir();
    // Place the door
    StrongholdDoor.getRandomDoor(this, getRandom()).place(1, 1, 0);
    // Place some random spider webs
    final SimpleBlockMaterialPicker picker = new SimpleBlockMaterialPicker(VanillaMaterials.WEB, VanillaMaterials.WEB);
    box.setPicker(picker);
    box.setMinMax(-1, 1, 1, 8, 4, 13).randomFill(0.07f);
    // Place bookshelves on the walls
    for (int zz = 1; zz <= 13; zz++) {
      final boolean planks = (zz - 1) % 4 == 0;
      final BlockMaterial material = planks ? VanillaMaterials.PLANK : VanillaMaterials.BOOKSHELF;
      picker.setOuterInnerMaterials(material, material);
      box.setMinMax(-2, 1, zz, -2, 4, zz).fill();
      box.offsetMinMax(11, 0, 0, 11, 0, 0).fill();
      if (planks) {
        attachMaterial(-1, 3, zz, VanillaMaterials.TORCH);
        attachMaterial(8, 3, zz, VanillaMaterials.TORCH);
      }
      if (isLargeRoom()) {
        box.setMinMax(-2, 6, zz, -2, 9, zz).fill();
        box.offsetMinMax(11, 0, 0, 11, 0, 0).fill();
      }
    }
    // Add more book shelves in the library
    picker.setOuterInnerMaterials(VanillaMaterials.BOOKSHELF, VanillaMaterials.BOOKSHELF);
    for (int i = 3; i < 12; i += 2) {
      box.setMinMax(0, 1, i, 1, 3, i).fill();
      box.offsetMinMax(3, 0, 0, 3, 0, 0).fill();
      box.offsetMinMax(3, 0, 0, 3, 0, 0).fill();
    }
    // More decoration for large libraries
    if (isLargeRoom()) {
      // Place the planks for the second floor
      picker.setOuterInnerMaterials(VanillaMaterials.PLANK, VanillaMaterials.PLANK);
      box.setMinMax(-2, 5, 1, 0, 5, 13).fill();
      box.offsetMinMax(9, 0, 0, 9, 0, 0).fill();
      box.setMinMax(1, 5, 1, 6, 5, 2).fill();
      box.offsetMinMax(0, 0, 11, 0, 0, 11).fill();
      setBlockMaterial(6, 5, 11, VanillaMaterials.PLANK);
      setBlockMaterial(5, 5, 11, VanillaMaterials.PLANK);
      setBlockMaterial(6, 5, 10, VanillaMaterials.PLANK);
      // Fences  on the second floor
      picker.setOuterInnerMaterials(VanillaMaterials.WOODEN_FENCE, VanillaMaterials.WOODEN_FENCE);
      box.setMinMax(0, 6, 2, 0, 6, 12).fill();
      box.offsetMinMax(7, 0, 0, 7, 0, -2).fill();
      box.setMinMax(1, 6, 2, 6, 6, 2).fill();
      box.offsetMinMax(0, 0, 10, -1, 0, 10).fill();
      setBlockMaterial(6, 6, 11, VanillaMaterials.WOODEN_FENCE);
View Full Code Here

TOP

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

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.