// Art Nouveau corner apothecary shop
// two floors, green tiled front, corner bay, mansard-ish roof, shop inside
var gy = 10; // ground level
var x, y, z, i;
// ground
fill(6, gy - 3, 6, 56, gy - 1, 56, b('dirt'));
fill(6, gy, 6, 56, gy, 56, b('grass_block'));
// street
fill(6, gy, 40, 56, gy, 56, b('stone'));
fill(6, gy, 6, 16, gy, 56, b('stone'));
var x1 = 20, x2 = 38, z1 = 18, z2 = 36;
var f1 = gy + 1; // ground floor level
var f2 = f1 + 6; // second floor level
var wallTop = f2 + 5;
// floor slabs
fill(x1, f1, z1, x2, f1, z2, b('spruce_planks'));
fill(x1, f2, z1, x2, f2, z2, b('spruce_planks'));
// walls ground floor - green tiles
for (y = f1 + 1; y <= f2 - 1; y++) {
fill(x1, y, z1, x2, y, z1, b('green_terracotta'));
fill(x1, y, z2, x2, y, z2, b('green_terracotta'));
fill(x1, y, z1, x1, y, z2, b('green_terracotta'));
fill(x2, y, z1, x2, y, z2, b('green_terracotta'));
}
// walls second floor - lighter
for (y = f2 + 1; y <= wallTop; y++) {
fill(x1, y, z1, x2, y, z1, b('white_terracotta'));
fill(x1, y, z2, x2, y, z2, b('white_terracotta'));
fill(x1, y, z1, x1, y, z2, b('white_terracotta'));
fill(x2, y, z1, x2, y, z2, b('white_terracotta'));
}
// rounded corner bay at the south-west corner
for (i = 0; i <= 90; i += 6) {
var a = i * Math.PI / 180;
var bx = Math.round(x1 + 5 - 5 * Math.cos(a));
var bz = Math.round(z2 - 5 + 5 * Math.sin(a));
for (y = f1 + 1; y <= wallTop; y++) {
pb(bx, y, bz, y < f2 ? 'green_terracotta' : 'white_terracotta');
}
}
// shop windows on the two street sides
for (x = x1 + 2; x <= x2 - 2; x++) {
if (x % 4 !== 0) continue;
for (y = f1 + 2; y <= f1 + 4; y++) {
pb(x, y, z2, 'glass');
pb(x, y + 6, z2, 'glass');
}
}
for (z = z1 + 2; z <= z2 - 2; z++) {
if (z % 4 !== 0) continue;
for (y = f1 + 2; y <= f1 + 4; y++) {
pb(x1, y, z, 'glass');
pb(x1, y + 6, z, 'glass');
}
}
// door on the corner
pb(24, f1 + 1, z2, 'air');
pb(24, f1 + 2, z2, 'air');
ps(24, f1 + 1, z2, 'dark_oak_door[facing=south,half=lower,hinge=left]');
ps(24, f1 + 2, z2, 'dark_oak_door[facing=south,half=upper,hinge=left]');
// glass canopy over the shop windows
for (x = x1; x <= x2; x++) pb(x, f2, z2 + 1, 'glass');
for (z = z1; z <= z2; z++) pb(x1 - 1, f2, z, 'glass');
// balcony railing on top of the canopy
for (x = x1; x <= x2; x++) pb(x, f2 + 1, z2 + 1, 'iron_bars');
// mansard roof - slate
for (i = 0; i < 4; i++) {
for (x = x1 - 1 + i; x <= x2 + 1 - i; x++) {
for (z = z1 - 1 + i; z <= z2 + 1 - i; z++) {
var edge = (x === x1 - 1 + i || x === x2 + 1 - i || z === z1 - 1 + i || z === z2 + 1 - i);
if (edge) pb(x, wallTop + 1 + i, z, 'deepslate_tiles');
}
}
}
fill(x1 + 3, wallTop + 5, z1 + 3, x2 - 3, wallTop + 5, z2 - 3, b('deepslate_tiles'));
// ceiling between floors is the second floor slab (already placed)
// counter inside the shop
for (x = 26; x <= 34; x++) {
pb(x, f1 + 1, 24, 'spruce_planks');
ps(x, f1 + 2, 24, 'spruce_slab[type=bottom]');
}
// shelves of bottles behind the counter
for (x = 26; x <= 34; x++) {
for (y = f1 + 1; y <= f1 + 3; y++) pb(x, y, z1 + 1, 'bookshelf');
}
pb(27, f1 + 1, 22, 'brewing_stand');
pb(31, f1 + 1, 22, 'brewing_stand');
pb(33, f1 + 1, 22, 'cauldron');
// a table
pb(26, f1 + 1, 30, 'oak_fence');
pb(26, f1 + 2, 30, 'oak_pressure_plate');
ps(25, f1 + 1, 30, 'oak_stairs[facing=east]');
ps(27, f1 + 1, 30, 'oak_stairs[facing=west]');
// stairs to the second floor
for (i = 0; i < 6; i++) {
ps(36, f1 + 1 + i, 30 - i, 'dark_oak_stairs[facing=north]');
pb(36, f2, 30 - i, 'air');
}
// upstairs: bed and a table
ps(24, f2 + 1, 22, 'red_bed[facing=north,part=foot]');
ps(24, f2 + 1, 21, 'red_bed[facing=north,part=head]');
pb(30, f2 + 1, 28, 'oak_fence');
pb(30, f2 + 2, 28, 'oak_pressure_plate');
// lights
pb(26, f2 - 1, 26, 'lantern');
pb(32, f2 - 1, 30, 'lantern');
pb(26, wallTop, 26, 'lantern');
// a couple of torches outside
pb(x1 - 2, gy + 1, z2 + 2, 'lantern');
pb(x2 + 2, gy + 1, z2 + 2, 'lantern');