// carousel
var i, x, y, z, d, r;
// ground
fill(-28, -2, -28, 28, -1, 28, "dirt");
fill(-28, 0, -28, 28, 0, 28, "grass_block");
// raised wooden platform
for (x = -13; x <= 13; x++) {
for (z = -13; z <= 13; z++) {
d = Math.sqrt(x * x + z * z);
if (d <= 13) {
pb(x, 1, z, "stone_bricks");
pb(x, 2, z, "oak_planks");
}
}
}
// central column
for (y = 3; y <= 16; y++) {
pb(0, y, 0, "quartz_pillar[axis=y]");
pb(1, y, 0, "white_stained_glass");
pb(-1, y, 0, "white_stained_glass");
pb(0, y, 1, "white_stained_glass");
pb(0, y, -1, "white_stained_glass");
}
// canopy - striped cone
for (i = 0; i <= 9; i++) {
y = 17 + i;
r = 14 - i * 1.4;
for (x = -14; x <= 14; x++) {
for (z = -14; z <= 14; z++) {
d = Math.sqrt(x * x + z * z);
if (d <= r && d > r - 2) {
var a = Math.atan2(z, x);
if (a < 0) a = a + Math.PI * 2;
var sec = Math.floor(a / (Math.PI * 2 / 12));
if (sec % 2 === 0) pb(x, y, z, "white_wool");
else pb(x, y, z, "red_wool");
}
}
}
}
pb(0, 27, 0, "gold_block");
// valance ring
for (x = -14; x <= 14; x++) {
for (z = -14; z <= 14; z++) {
d = Math.sqrt(x * x + z * z);
if (d <= 14 && d > 13) {
pb(x, 16, z, "gold_block");
}
}
}
// lanterns
for (i = 0; i < 12; i++) {
var la = (Math.PI * 2 / 12) * i;
var lx = Math.round(Math.cos(la) * 13);
var lz = Math.round(Math.sin(la) * 13);
pb(lx, 15, lz, "lantern[hanging=true]");
}
// horses on poles
for (i = 0; i < 8; i++) {
var ha = (Math.PI * 2 / 8) * i;
var hx = Math.round(Math.cos(ha) * 9);
var hz = Math.round(Math.sin(ha) * 9);
// pole
for (y = 3; y <= 15; y++) pb(hx, y, hz, "chain[axis=y]");
// horse body
fill(hx - 1, 6, hz - 1, hx + 1, 7, hz + 1, "white_wool");
pb(hx, 8, hz, "white_wool");
pb(hx + 1, 8, hz, "white_wool");
pb(hx, 5, hz - 1, "white_wool");
pb(hx, 5, hz + 1, "white_wool");
pb(hx, 8, hz + 1, "red_wool");
}
// steps
for (i = 0; i < 3; i++) {
for (x = -2; x <= 2; x++) {
pb(x, 2 - i, 13 + i, "stone_brick_stairs[facing=south]");
}
}
// path
for (z = 17; z <= 27; z++) {
for (x = -2; x <= 2; x++) pb(x, 0, z, "gravel");
}
// a couple of trees
for (i = 0; i < 5; i++) pb(20, 1 + i, 10, "oak_log[axis=y]");
for (x = 18; x <= 22; x++) for (z = 8; z <= 12; z++) for (y = 6; y <= 7; y++) pb(x, y, z, "oak_leaves[persistent=true]");
for (i = 0; i < 5; i++) pb(-20, 1 + i, -10, "oak_log[axis=y]");
for (x = -22; x <= -18; x++) for (z = -12; z <= -8; z++) for (y = 6; y <= 7; y++) pb(x, y, z, "oak_leaves[persistent=true]");
// benches
for (i = 0; i < 3; i++) {
pb(-16 + i, 1, 6, "oak_stairs[facing=east]");
pb(16 - i, 1, -6, "oak_stairs[facing=west]");
}