}
@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);