// Indian stepwell - simple version
// square pit with steps going down on all sides, water at the bottom
var cx = 32, cz = 32;
var GY = 20;
// ground
fill(0, 0, 0, 63, GY - 1, 63, "dirt");
fill(0, GY, 0, 63, GY, 63, "grass_block");
// the block of stone the well is cut out of
fill(cx - 22, 6, cz - 22, cx + 22, GY, cz + 22, "sandstone");
// cut the steps: each level down is one block narrower
var d, hw;
for (d = 0; d < 12; d++) {
hw = 20 - d;
fill(cx - hw, GY - d, cz - hw, cx + hw, GY - d, cz + hw, "air");
}
// water at the bottom
fill(cx - 8, 8, cz - 8, cx + 8, 9, cz + 8, "sandstone");
fill(cx - 8, 10, cz - 8, cx + 8, 10, cz + 8, "water");
// four small kiosks at the corners of the rim
var corners = [[-21, -21], [21, -21], [-21, 21], [21, 21]];
var i, k, px, pz;
for (i = 0; i < corners.length; i++) {
px = cx + corners[i][0];
pz = cz + corners[i][1];
fill(px - 2, GY + 1, pz - 2, px - 2, GY + 4, pz - 2, "sandstone");
fill(px + 2, GY + 1, pz - 2, px + 2, GY + 4, pz - 2, "sandstone");
fill(px - 2, GY + 1, pz + 2, px - 2, GY + 4, pz + 2, "sandstone");
fill(px + 2, GY + 1, pz + 2, px + 2, GY + 4, pz + 2, "sandstone");
fill(px - 2, GY + 5, pz - 2, px + 2, GY + 5, pz + 2, "sandstone");
pb(px, GY + 4, pz, "torch");
}
// a low wall around the pit
for (i = -22; i <= 22; i++) {
if (i < -3 || i > 3) {
pb(cx + i, GY + 1, cz - 22, "sandstone_wall");
pb(cx + i, GY + 1, cz + 22, "sandstone_wall");
pb(cx - 22, GY + 1, cz + i, "sandstone_wall");
pb(cx + 22, GY + 1, cz + i, "sandstone_wall");
}
}
// torches down in the well
for (i = 0; i < 4; i++) {
pb(cx - 12 + i * 8, GY - 8, cz - 12, "torch");
pb(cx - 12 + i * 8, GY - 8, cz + 12, "torch");
}