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

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


        .addMaterial(VanillaMaterials.COMPASS, 1, 1, 1);
  }

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


  }

  @Override
  public void place() {
    // General shape
    final PieceCuboidBuilder box = new PieceCuboidBuilder(this);
    box.setPicker(new StrongholdBlockMaterialPicker(getRandom()));
    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);
      setBlockMaterial(5, 6, 11, VanillaMaterials.WOODEN_FENCE);
      setBlockMaterial(6, 6, 10, VanillaMaterials.WOODEN_FENCE);
      // Ladders for the first to the second floor
      setBlockMaterial(7, 1, 13, VanillaMaterials.LADDER, (short) 2);
View Full Code Here

        .addMaterial(VanillaMaterials.GOLDEN_APPLE, 1, 1, 1);
  }

  @Override
  public boolean canPlace() {
    final PieceCuboidBuilder box = new PieceCuboidBuilder(this);
    box.setMinMax(-1, -1, -1, 5, 5, 7);
    return !box.intersectsLiquids();
  }
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, 6).toggleIgnoreAir().fill();
    box.toggleIgnoreAir();
    // Place the doors
    StrongholdDoor.getRandomDoor(this, getRandom()).place(1, 1, 0);
    new EmptyDoorway(this).place(1, 1, 6);
    // Place the floor
    box.setPicker(new SimpleBlockMaterialPicker(VanillaMaterials.STONE_BRICK, VanillaMaterials.STONE_BRICK));
    box.setMinMax(3, 1, 2, 3, 1, 4).fill();
    // Build the loot chest pedestal
    setBlockMaterial(3, 1, 1, Slab.STONE);
    setBlockMaterial(3, 1, 5, Slab.STONE);
    setBlockMaterial(3, 2, 2, Slab.STONE);
    setBlockMaterial(3, 2, 4, Slab.STONE);
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.