// === BUILD PLAN ===
// Style: Streamline Moderne diner, Modern/Contemporary rules (flat roof, horizontal lines, curtain glass)
// Footprint: rect x14..44 z20..38, ROUNDED SE corner (quarter circle r=9 @ 35,29)
// Ground: floor y11, walk y12, ceiling y18 (6 tall, curtain glass) ; office box x16..32 z22..34, walk y19, deck y24
// GROUND (Z down = south):
// ###booth booth booth booth###
// # S #
// # | kitchen line #
// # | =====counter===== #
// # v o o o o o o /
// #####################___/ <- ARCH on the curve
// SIGN: freestanding roadside PYLON in the lot, "EAT" stacked vertically, glowstone BEHIND letters
// MATERIALS PLAN:
// plinth y12 : red_concrete - WHY: enamel base band, grounds the glass
// curtain y13-16 : white_stained_glass (glass block) with smooth_quartz mullions - WHY: the Moderne glass corner
// chrome y17 : iron_block + projecting light_gray slab - WHY: speedline relief, not a flat box
// fascia y18 : red_concrete + quartz cornice ring
// floor : 2x2 checkerboard black/white concrete - WHY: diner icon at proper scale
// roof : flat deck + parapet coping (Modern = flat roofs ONLY)
// STAIR PLAN: walk 12 -> 19 (delta 7) -> staircase(17,25,12,19,'south'), 8 cells z25..z32, inside the office box
// === END PLAN ===
var X1 = 14, X2 = 44, Z1 = 20, Z2 = 38;
var RR = 9, RX = 35, RZ = 29;
var OX1 = 16, OX2 = 32, OZ1 = 22, OZ2 = 34;
var padY = 10, floorY = 11, walkY = 12, ceilY = 18, walkY2 = 19, ceil2Y = 24;
function ins(x, z) {
if (x < X1 || x > X2 || z < Z1 || z > Z2) return false;
if (x > RX && z > RZ) { var a = x - RX, c = z - RZ; return (a * a + c * c) <= RR * RR; }
return true;
}
function wall(x, z) {
if (!ins(x, z)) return false;
return (!ins(x + 1, z) || !ins(x - 1, z) || !ins(x, z + 1) || !ins(x, z - 1));
}
function inO(x, z) { return x >= OX1 && x <= OX2 && z >= OZ1 && z <= OZ2; }
function oWall(x, z) { return inO(x, z) && (x === OX1 || x === OX2 || z === OZ1 || z === OZ2); }
// === TERRAIN ===
var ground = terrain({
cx: 30, cz: 30, radius: 29, baseY: padY - 1, amp: 3, scale: 0.05, seed: 11, irregularity: 0.35,
surface: [{ block: 'grass_block', w: 7 }, { block: 'coarse_dirt', w: 2 }],
sub: 'dirt', deep: 'stone', depth: 4,
pads: [{ cx: 29, cz: 32, r: 23, y: padY, falloff: 8 }]
});
// === APRON / LOT ===
var ax, az;
for (ax = 8; ax <= 54; ax++) {
for (az = 14; az <= 52; az++) {
if (ins(ax, az)) continue;
var d2 = (ax >= X1 - 2 && ax <= X2 + 2 && az >= Z1 - 2 && az <= Z2 + 2);
var lot = (az >= 40 && az <= 50 && ax >= 12 && ax <= 50);
if (d2) pb(ax, floorY, az, 'smooth_quartz');
else if (lot) pb(ax, floorY, az, (((ax - 12) % 7 === 0) && az >= 42 && az <= 49) ? 'white_concrete' : 'gray_concrete');
}
}
// === CLEAR ENVELOPE ===
var q, w, e;
for (q = X1 - 1; q <= X2 + 1; q++) {
for (w = Z1 - 1; w <= Z2 + 1; w++) {
if (!ins(q, w)) continue;
for (e = floorY; e <= ceil2Y + 3; e++) pb(q, e, w, 'air');
}
}
// === FLOOR (2x2 checkerboard) + WALLS ===
var x, z, y;
for (x = X1; x <= X2; x++) {
for (z = Z1; z <= Z2; z++) {
if (!ins(x, z)) continue;
var cell = ((Math.floor((x - X1) / 2) + Math.floor((z - Z1) / 2)) % 2 === 0);
pb(x, floorY, z, cell ? 'black_concrete' : 'white_concrete');
if (!wall(x, z)) continue;
var mull = ((x + z) % 5 === 0);
for (y = walkY; y <= ceilY; y++) {
var blk;
if (y === walkY) blk = 'red_concrete';
else if (y <= walkY + 4) blk = mull ? 'smooth_quartz' : 'white_stained_glass';
else if (y === walkY + 5) blk = 'iron_block';
else blk = 'red_concrete';
pb(x, y, z, blk);
}
}
}
// === CHROME SPEEDLINE + CORNICE (relief) ===
var D = [[1, 0, 'east'], [-1, 0, 'west'], [0, 1, 'south'], [0, -1, 'north']];
for (x = X1 - 1; x <= X2 + 1; x++) {
for (z = Z1 - 1; z <= Z2 + 1; z++) {
if (!wall(x, z)) continue;
var k;
for (k = 0; k < 4; k++) {
var nx = x + D[k][0], nz = z + D[k][1];
if (ins(nx, nz)) continue;
ps(nx, walkY + 5, nz, 'light_gray_concrete_slab' ? 'smooth_quartz_slab[type=top]' : 'smooth_quartz_slab[type=top]');
roofStair(nx, ceilY, nz, 'smooth_quartz_stairs', D[k][2], 'top');
pb(nx, walkY, nz, 'red_concrete'); // plinth wraps out 1 = base relief
}
}
}
// === ENTRANCE ARCH ON THE CURVE + CANOPY ===
var gx, gz;
for (gx = RX; gx <= X2; gx++) {
for (gz = RZ; gz <= Z2; gz++) {
if (!wall(gx, gz)) continue;
var u = gx - 41.4, v = gz - 35.4;
if (u * u + v * v <= 4.0) {
pb(gx, walkY, gz, 'air'); pb(gx, walkY + 1, gz, 'air'); pb(gx, walkY + 2, gz, 'air');
pb(gx, walkY + 3, gz, 'iron_block');
if (!ins(gx + 1, gz)) ps(gx + 1, floorY, gz, 'smooth_quartz_slab[type=top]');
if (!ins(gx, gz + 1)) ps(gx, floorY, gz + 1, 'smooth_quartz_slab[type=top]');
}
}
}
// projecting canopy over the curve
var cw;
for (cw = 0; cw < 360; cw += 4) {
var rad = cw * Math.PI / 180;
if (cw < 0) continue;
var px = Math.round(RX + Math.cos(rad) * (RR + 2)), pz = Math.round(RZ + Math.sin(rad) * (RR + 2));
if (px > RX && pz > RZ && !ins(px, pz)) ps(px, walkY + 4, pz, 'smooth_quartz_slab[type=top]');
}
// === ROOF DECK / OFFICE FLOOR + PARAPET ===
for (x = X1; x <= X2; x++) {
for (z = Z1; z <= Z2; z++) {
if (!ins(x, z) || wall(x, z)) continue;
if (inO(x, z)) pb(x, ceilY, z, 'light_gray_concrete');
else pb(x, ceilY, z, ((x * 2 + z) % 13 === 0) ? 'sea_lantern' : 'white_concrete');
}
}
for (x = X1; x <= X2; x++) {
for (z = Z1; z <= Z2; z++) {
if (!wall(x, z)) continue;
pb(x, ceilY + 1, z, 'smooth_quartz');
ps(x, ceilY + 2, z, 'light_gray_concrete');
}
}
// === OFFICE BOX (setback, banded) ===
for (x = OX1; x <= OX2; x++) {
for (z = OZ1; z <= OZ2; z++) {
if (!oWall(x, z)) continue;
var m2 = ((x + z) % 6 === 0);
for (y = walkY2; y <= ceil2Y; y++) {
var b2;
if (y === walkY2) b2 = 'red_concrete';
else if (y <= walkY2 + 3) b2 = m2 ? 'smooth_quartz' : 'glass';
else if (y === walkY2 + 4) b2 = 'iron_block';
else b2 = 'smooth_quartz';
pb(x, y, z, b2);
}
pb(x, ceil2Y + 1, z, 'red_concrete');
ps(x, ceil2Y + 2, z, 'smooth_quartz_slab[type=top]');
var k2;
for (k2 = 0; k2 < 4; k2++) {
var ox2 = x + D[k2][0], oz2 = z + D[k2][1];
if (inO(ox2, oz2)) continue;
ps(ox2, walkY2 + 4, oz2, 'smooth_quartz_slab[type=top]');
}
}
}
for (x = OX1 + 1; x <= OX2 - 1; x++) {
for (z = OZ1 + 1; z <= OZ2 - 1; z++) pb(x, ceil2Y, z, ((x + z) % 11 === 0) ? 'sea_lantern' : 'white_concrete');
}
// === ROADSIDE NEON PYLON "EAT" ===
var GL = {
E: ['111', '100', '110', '100', '111'],
A: ['111', '101', '111', '101', '101'],
T: ['111', '010', '010', '010', '010']
};
var stack = 'EAT', pz2 = 41, plx = 40, topRow = 33;
var s1, s2, s3;
for (s1 = 0; s1 < stack.length; s1++) {
var G = GL[stack.charAt(s1)];
for (s2 = 0; s2 < 5; s2++) {
for (s3 = 0; s3 < 3; s3++) {
if (G[s2].charAt(s3) === '1') {
var lx = plx + s3, ly = topRow - s1 * 6 - s2;
pb(lx, ly, pz2, 'red_concrete');
pb(lx, ly, pz2 + 1, 'glowstone');
}
}
}
}
var pyl;
for (pyl = floorY + 1; pyl <= topRow + 1; pyl++) {
pb(39, pyl, pz2, 'polished_blackstone');
pb(43, pyl, pz2, 'polished_blackstone');
}
for (pyl = 39; pyl <= 43; pyl++) { pb(pyl, topRow + 1, pz2, 'polished_blackstone'); pb(pyl, topRow - 16, pz2, 'polished_blackstone'); }
pb(41, topRow + 2, pz2, 'red_concrete'); pb(40, topRow + 2, pz2, 'red_concrete'); pb(42, topRow + 2, pz2, 'red_concrete');
// === INTERIOR: DINER ===
var i;
// counter z=27 (x22..34) with chrome top + stools
for (i = 22; i <= 34; i++) {
pb(i, walkY, 27, 'smooth_quartz');
ps(i, walkY + 1, 27, 'smooth_quartz_stairs[facing=south,half=top]');
}
for (i = 22; i <= 34; i += 2) {
pb(i, walkY, 28, 'polished_blackstone_wall');
ps(i, walkY + 1, 28, 'red_carpet');
}
// kitchen line behind the counter
for (i = 22; i <= 34; i++) {
if (i % 4 === 0) ps(i, walkY, 25, 'furnace[facing=south,lit=false]');
else if (i % 4 === 1) ps(i, walkY, 25, 'smoker[facing=south]');
else pb(i, walkY, 25, 'iron_block');
ps(i, walkY + 1, 25, (i % 4 === 0 || i % 4 === 1) ? 'iron_trapdoor[facing=south,half=bottom,open=false]' : 'smooth_quartz_slab[type=bottom]');
}
ps(23, walkY, 24, 'water_cauldron[level=3]');
pb(21, walkY, 24, 'barrel'); pb(21, walkY, 23, 'chest');
// booths along the north window band
var bb;
for (bb = 20; bb <= 34; bb += 5) {
pb(bb, walkY, 22, 'oak_fence'); ps(bb, walkY + 1, 22, 'white_pressure_plate');
pb(bb + 1, walkY, 22, 'oak_fence'); ps(bb + 1, walkY + 1, 22, 'white_pressure_plate');
chairStair(bb, walkY, 21, 'red_concrete_stairs', 'south');
chairStair(bb + 1, walkY, 21, 'red_concrete_stairs', 'south');
chairStair(bb, walkY, 23, 'red_concrete_stairs', 'north');
chairStair(bb + 1, walkY, 23, 'red_concrete_stairs', 'north');
}
// window bar along the curved corner
var arc;
for (arc = 0; arc < 90; arc += 12) {
var ar = arc * Math.PI / 180;
var bx2 = Math.round(RX + Math.cos(ar) * (RR - 3)), bz2 = Math.round(RZ + Math.sin(ar) * (RR - 3));
if (!ins(bx2, bz2)) continue;
pb(bx2, walkY, bz2, 'polished_blackstone_wall');
ps(bx2, walkY + 1, bz2, 'smooth_quartz_slab[type=bottom]');
}
pb(43, walkY, 22, 'jukebox'); pb(43, walkY + 1, 22, 'note_block');
var LT = [[20, 26], [26, 31], [32, 26], [38, 31], [24, 35], [32, 35]];
for (i = 0; i < LT.length; i++) ps(LT[i][0], ceilY - 1, LT[i][1], 'lantern[hanging=true]');
// === STAIRS ===
var topcell = staircase(17, 25, walkY, walkY2, 'south', { width: 1, material: 'smooth_quartz_stairs', support: 'light_gray_concrete', rail: true });
// === OFFICE ===
var ry, rz2;
for (ry = 22; ry <= 27; ry++) for (rz2 = 28; rz2 <= 32; rz2++) ps(ry, walkY2, rz2, 'gray_carpet');
pb(24, walkY2, 29, 'spruce_fence'); ps(24, walkY2 + 1, 29, 'smooth_quartz_slab[type=bottom]');
pb(25, walkY2, 29, 'spruce_fence'); ps(25, walkY2 + 1, 29, 'smooth_quartz_slab[type=bottom]');
ps(24, walkY2, 30, 'spruce_trapdoor[facing=north,half=bottom,open=false]');
chairStair(24, walkY2, 30, 'spruce_stairs', 'north');
var sh;
for (sh = 28; sh <= 31; sh++) for (ry = 0; ry < 2; ry++) pb(sh, walkY2 + ry, 33, (sh % 3 === 0) ? 'chiseled_bookshelf' : 'bookshelf');
pb(30, walkY2, 24, 'barrel'); pb(31, walkY2, 24, 'barrel'); pb(29, walkY2, 24, 'chest');
ps(22, ceil2Y - 1, 30, 'lantern[hanging=true]');
ps(29, ceil2Y - 1, 28, 'lantern[hanging=true]');
pb(31, walkY2, 32, 'flower_pot');
// === EXTERIOR DETAIL ===
var P = [[10, 44], [10, 50], [52, 44], [52, 50], [10, 18], [52, 18]];
for (i = 0; i < P.length; i++) {
var lx2 = P[i][0], lz2 = P[i][1];
for (y = floorY + 1; y <= floorY + 4; y++) pb(lx2, y, lz2, 'polished_blackstone_wall');
pb(lx2, floorY + 5, lz2, 'sea_lantern');
}
var PLT = [[12, 39], [16, 39], [48, 39], [46, 20]];
for (i = 0; i < PLT.length; i++) {
pb(PLT[i][0], floorY, PLT[i][1], 'smooth_quartz');
pb(PLT[i][0], floorY + 1, PLT[i][1], 'oak_leaves[persistent=true]');
}