// Icelandic turf farmhouse - three gabled houses side by side
// ground
fill(0, 0, 0, 39, 0, 35, 'dirt');
fill(0, 1, 0, 39, 1, 35, 'grass_block');
function house(x1, x2, z1, z2, h) {
// stone foundation
fill(x1, 2, z1, x2, 2, z2, 'cobblestone');
// turf walls
fill(x1, 3, z1, x2, 2 + h, z2, 'dirt');
fill(x1 + 1, 3, z1 + 1, x2 - 1, 2 + h, z2 - 1, 'air');
// floor
fill(x1 + 1, 2, z1 + 1, x2 - 1, 2, z2 - 1, 'oak_planks');
// white front wall
fill(x1 + 1, 3, z1, x2 - 1, 2 + h, z1, 'white_wool');
// grass roof (gable)
var w = x2 - x1;
var half = Math.floor(w / 2) + 1;
for (var i = 0; i < half; i++) {
fill(x1 + i, 3 + h + i, z1, x2 - i, 3 + h + i, z2, 'grass_block');
if (x1 + i + 1 <= x2 - i - 1) fill(x1 + i + 1, 3 + h + i, z1 + 1, x2 - i - 1, 3 + h + i, z2 - 1, 'air');
// gable front
if (x1 + i + 1 <= x2 - i - 1) fill(x1 + i + 1, 3 + h + i, z1, x2 - i - 1, 3 + h + i, z1, 'white_wool');
}
// door
var dx = Math.floor((x1 + x2) / 2);
pb(dx, 3, z1, 'air'); pb(dx, 4, z1, 'air');
ps(dx, 3, z1, 'crimson_door[facing=north,half=lower]');
ps(dx, 4, z1, 'crimson_door[facing=north,half=upper]');
// windows
pb(dx - 2, 4, z1, 'glass_pane');
pb(dx + 2, 4, z1, 'glass_pane');
}
house(4, 12, 10, 24, 4);
house(12, 22, 10, 26, 5);
house(22, 30, 10, 24, 4);
// interior of middle house: hearth and loft
pb(17, 3, 24, 'cobblestone');
pb(17, 4, 24, 'campfire');
fill(13, 6, 18, 21, 6, 25, 'oak_planks'); // loft floor
for (var y = 3; y <= 6; y++) ps(13, y, 17, 'ladder[facing=south]');
pb(14, 3, 13, 'crafting_table');
pb(15, 3, 13, 'chest');
pb(20, 3, 14, 'oak_fence'); pb(20, 4, 14, 'oak_pressure_plate');
ps(19, 3, 14, 'oak_stairs[facing=east]');
pb(15, 7, 22, 'red_bed');
pb(19, 7, 22, 'red_bed');
pb(17, 5, 15, 'torch');
// side houses
pb(6, 3, 20, 'furnace'); pb(8, 3, 20, 'chest'); pb(10, 3, 20, 'barrel');
pb(24, 3, 20, 'anvil'); pb(26, 3, 20, 'crafting_table'); pb(28, 3, 20, 'barrel');
// drying rack
pb(8, 2, 5, 'oak_fence'); pb(8, 3, 5, 'oak_fence'); pb(8, 4, 5, 'oak_fence');
pb(12, 2, 5, 'oak_fence'); pb(12, 3, 5, 'oak_fence'); pb(12, 4, 5, 'oak_fence');
fill(8, 5, 5, 12, 5, 5, 'oak_planks');
// sheep
pb(25, 2, 4, 'white_wool'); pb(26, 2, 4, 'white_wool');
pb(30, 2, 6, 'white_wool'); pb(31, 2, 6, 'white_wool');
pb(20, 2, 3, 'white_wool'); pb(21, 2, 3, 'white_wool');
// path
fill(17, 1, 0, 17, 1, 9, 'gravel');