// Yemeni Shibam-style mud brick tower house
// 5 floors, flat roof terrace with parapet, small windows, stone plinth, desert ground
// ground
fill(4, 0, 4, 60, 5, 60, 'sandstone');
fill(4, 6, 4, 60, 6, 60, 'sand');
// stone plinth
fill(22, 7, 22, 40, 8, 40, 'smooth_sandstone');
// tower shell: 5 floors, each 5 high, walls of terracotta
var floorY = 9;
var f;
for (f = 0; f < 5; f++) {
var y0 = floorY + f * 5;
// walls
fill(24, y0, 24, 38, y0 + 4, 24, 'terracotta');
fill(24, y0, 38, 38, y0 + 4, 38, 'terracotta');
fill(24, y0, 24, 24, y0 + 4, 38, 'terracotta');
fill(38, y0, 24, 38, y0 + 4, 38, 'terracotta');
// floor slab
fill(24, y0, 24, 38, y0, 38, 'smooth_sandstone');
// hollow the inside
fill(25, y0 + 1, 25, 37, y0 + 4, 37, 'air');
}
// roof terrace floor
fill(24, 34, 24, 38, 34, 38, 'smooth_sandstone');
// parapet with crenellations
fill(24, 35, 24, 38, 35, 24, 'white_concrete');
fill(24, 35, 38, 38, 35, 38, 'white_concrete');
fill(24, 35, 24, 24, 35, 38, 'white_concrete');
fill(38, 35, 24, 38, 35, 38, 'white_concrete');
var p;
for (p = 24; p <= 38; p = p + 2) {
pb(p, 36, 24, 'white_concrete');
pb(p, 36, 38, 'white_concrete');
pb(24, 36, p, 'white_concrete');
pb(38, 36, p, 'white_concrete');
}
// windows on all four sides of each floor, with white frames
var wx, wz;
for (f = 0; f < 5; f++) {
var wy = floorY + f * 5 + 2;
for (wx = 27; wx <= 35; wx = wx + 4) {
pb(wx, wy, 24, 'glass_pane');
pb(wx, wy, 38, 'glass_pane');
pb(wx - 1, wy, 24, 'white_concrete');
pb(wx + 1, wy, 24, 'white_concrete');
pb(wx - 1, wy, 38, 'white_concrete');
pb(wx + 1, wy, 38, 'white_concrete');
}
for (wz = 27; wz <= 35; wz = wz + 4) {
pb(24, wy, wz, 'glass_pane');
pb(38, wy, wz, 'glass_pane');
pb(24, wy, wz - 1, 'white_concrete');
pb(24, wy, wz + 1, 'white_concrete');
pb(38, wy, wz - 1, 'white_concrete');
pb(38, wy, wz + 1, 'white_concrete');
}
}
// door on the south side
fill(31, 10, 38, 31, 11, 38, 'air');
ps(31, 10, 38, 'dark_oak_door[facing=south,half=lower,hinge=left]');
ps(31, 11, 38, 'dark_oak_door[facing=south,half=upper,hinge=left]');
// steps up to the door
fill(30, 8, 39, 32, 8, 39, 'sandstone');
fill(30, 7, 40, 32, 7, 40, 'sandstone');
// stairs between floors (ladder shaft in the corner)
var ly;
for (ly = 10; ly <= 34; ly++) {
ps(36, ly, 26, 'ladder[facing=west]');
}
// holes through the floors for the ladder
for (f = 1; f < 6; f++) {
fill(36, floorY + f * 5, 26, 36, floorY + f * 5, 26, 'air');
}
// interiors
for (f = 0; f < 5; f++) {
var iy = floorY + f * 5 + 1;
// some furniture
pb(27, iy, 27, 'barrel');
pb(28, iy, 27, 'crafting_table');
pb(30, iy, 30, 'red_carpet');
pb(31, iy, 30, 'red_carpet');
pb(30, iy, 31, 'red_carpet');
pb(31, iy, 31, 'red_carpet');
pb(34, iy, 34, 'chest');
pb(27, iy + 3, 34, 'lantern');
}
// majlis on floor 3: carpets and seats
var mi;
for (mi = 26; mi <= 36; mi++) {
pb(mi, 21, 26, 'red_carpet');
pb(mi, 21, 36, 'red_carpet');
}
ps(28, 21, 25, 'dark_oak_stairs[facing=south]');
ps(30, 21, 25, 'dark_oak_stairs[facing=south]');
ps(32, 21, 25, 'dark_oak_stairs[facing=south]');
pb(26, 26, 30, 'lantern');
// bed on floor 4
ps(27, 26, 27, 'red_bed[facing=north,part=foot]');
ps(27, 26, 26, 'red_bed[facing=north,part=head]');
// path and a couple of trees outside
var i;
for (i = 41; i <= 52; i++) {
fill(30, 6, i, 32, 6, i, 'smooth_sandstone');
}
placeTree(18, 7, 45, 'acacia');
placeTree(46, 7, 30, 'acacia');
pb(20, 7, 30, 'cactus');
pb(44, 7, 48, 'cactus');