Standard projects: generators of the house, workshop and station schematics

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Fulldroper
2026-10-15 08:13:55 +03:00
co-authored by Claude Opus 5.5
parent 5203335655
commit 2ce1b9c29a
5 changed files with 360 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
# Типові проекти
Генератори схематик, які держава продає (магазин → «Типовий проект: …») і замовляє в будівельних тендерах.
- `house.js` — житловий будинок 10×8, два поверхи;
- `workshop.js` — цех 14×14, висока зала з воротами;
- `station.js` — вокзал і перон 24 блоки з колією Create;
- `civic/kit.js` — стиль державного кварталу (цегла, копікет-колони, смерековий дах).
Збираються набором інструментів зі скіла `minecraft-building` (робоча копія `D:\code\workspace\tmp\minecraft-house`):
скрипти кладуться в `builds/projects/`, далі
node run.js projects/house --no-schem # перевірка й рендери
node export-nbt.js projects/house out/projects/createrp_house.nbt 1 # структура Create, без землі (від y 1)
Готові `.nbt` лежать у збірках: сервер — `schematics/uploaded/createrp/`, клієнт — `schematics/`.
+163
View File
@@ -0,0 +1,163 @@
// Create RP state quarter — the house style, taken from the user's own warehouse / import office and corrected
// by him on 2026-10-11:
// - red brick walls; the wall corner itself is brick;
// - columns are Copycats+ vertical steps (dark oak) standing IN FRONT of the wall at the corners, not logs in the wall;
// - the "foundation" is a facade strip: a thin copycat slice of stone bricks along the foot of the wall;
// - window sills and the beam under the gable window are copycat steps in dark oak;
// - windows are Create tiled glass panes;
// - the roof is spruce STAIRS with dark oak barge boards and ribs — no smooth slopes;
// - stone means plain stone / stone bricks.
// One chunk per building: x 0..15, z 0..15, front toward +z, pavement y 0, platform/floor y 1.
const { World } = require('../../lib/world')
const { roofs } = require('../../lib/roof')
const C = (n) => 'create:' + n
const P = {
wall: 'bricks', pave: 'stone_bricks', plinth: 'stone_bricks', pier: 'stone_bricks',
floor: 'bamboo_mosaic', upper: 'spruce_planks', pane: C('tiled_glass_pane'), fence: 'dark_oak_fence',
iron: C('industrial_iron_block'), girder: C('metal_girder'), casing: C('andesite_casing'), brass: C('brass_casing'),
wood: 'dark_oak_planks', column: 'dark_oak_log'
}
const post = ['dark_oak_log', { axis: 'y' }]
const beam = (axis) => ['stripped_dark_oak_log', { axis }]
const OUT = { south: [0, 1], north: [0, -1], east: [1, 0], west: [-1, 0] }
const TOWARD = { south: 'north', north: 'south', east: 'west', west: 'east' } // from the facade cell toward the wall
const STEP = 5 // storey height: floor block + 4 clear
// ---- copycat pieces (the material goes into the block entity; `_mat` is read by the renderer and the exporter) ----
// thin strip against the wall: 8 high, 4 deep
const strip = (side, mat = P.plinth) => ['copycats:copycat_slice', { facing: TOWARD[side], half: 'bottom', layers: 1, _mat: mat }]
// sill / beam: 8 high, 8 deep, in the top half of the cell
const sill = (side, mat = P.wood) => ['create:copycat_step', { facing: TOWARD[side], half: 'top', _mat: mat }]
// column: 8 x 8 pillar in the quarter of the cell that touches the wall at its outer end.
// Copycats+ vertical step: `facing` F fills the quarter between F and counter-clockwise(F).
const QUARTER = { 'north,west': 'north', 'west,south': 'west', 'south,east': 'south', 'east,north': 'east' }
const column = (toWall, toEnd, mat = P.column) => ['copycats:copycat_vertical_step', { facing: QUARTER[`${toWall},${toEnd}`] || QUARTER[`${toEnd},${toWall}`], _mat: mat }]
function start () {
const w = new World()
w.box(0, -1, 0, 15, -1, 15, 'dirt'); w.box(0, 0, 0, 15, 0, 15, P.pave)
const R = roofs(w, { body: P.wall, ceiling: P.upper })
return { w, R, interiors: [], rooms: [] }
}
const air = (w, x, y, z) => w.get(x, y, z).name === 'air'
// A brick block of `storeys` on a stone platform. `facade` = the sides that are outside walls.
function body (ctx, { x1, z1, x2, z2, storeys = 1, y0 = 1, name = 'hall', floor = P.floor, facade = ['south', 'north', 'east', 'west'] }) {
const { w } = ctx
const top = y0 + STEP * storeys // wall top row
for (let x = x1; x <= x2; x++) for (let z = z1; z <= z2; z++) {
const edge = x === x1 || x === x2 || z === z1 || z === z2
w.set(x, y0, z, edge ? P.plinth : floor)
for (let s = 1; s < storeys; s++) if (!edge) w.set(x, y0 + STEP * s, z, P.upper)
if (!edge) continue
for (let y = y0 + 1; y <= top; y++) {
const belt = (y - y0) % STEP === 0 && y < top
const corner = (x === x1 || x === x2) && (z === z1 || z === z2)
if (belt && !corner) w.set(x, y, z, ...beam(z === z1 || z === z2 ? 'x' : 'z'))
else w.set(x, y, z, P.wall)
}
}
for (let s = 0; s < storeys; s++) {
ctx.interiors.push([x1 + 1, y0 + STEP * s + 1, z1 + 1, x2 - 1, y0 + STEP * s + 4, z2 - 1])
ctx.rooms.push({ name: name + s, x: [x1 + 1, x2 - 1], z: [z1 + 1, z2 - 1], y: y0 + STEP * s + 1 }) // y = where the feet are
}
const wallCell = (side, a) => side === 'south' ? [a, z2] : side === 'north' ? [a, z1] : side === 'east' ? [x2, a] : [x1, a]
const span = (side) => side === 'south' || side === 'north' ? [x1, x2] : [z1, z2]
const base = (s) => y0 + STEP * s
const B = { x1, z1, x2, z2, top, y0, storeys, base }
// facade layer: the stone strip along the foot of every outside wall, columns at the corners of front and back
for (const side of facade) {
const [dx, dz] = OUT[side]; const [a1, a2] = span(side)
for (let a = a1; a <= a2; a++) { const [x, z] = wallCell(side, a); if (air(w, x + dx, y0 + 1, z + dz)) w.set(x + dx, y0 + 1, z + dz, ...strip(side)) }
if (side === 'east' || side === 'west') continue
for (const [a, end] of [[a1, 'west'], [a2, 'east']]) {
const [x, z] = wallCell(side, a)
for (let y = y0 + 1; y < top; y++) if (air(w, x + dx, y, z + dz) || w.get(x + dx, y, z + dz).name.includes('copycat_slice')) w.set(x + dx, y, z + dz, ...column(TOWARD[side], end))
}
}
// window `width` wide, two high, with a copycat sill outside; `a` = first cell along the wall
B.window = (side, a, s = 0, { width = 2, pane = P.pane, sill: withSill = true } = {}) => {
const [dx, dz] = OUT[side]
for (let i = 0; i < width; i++) {
const [x, z] = wallCell(side, a + i)
w.set(x, base(s) + 2, z, pane); w.set(x, base(s) + 3, z, pane)
if (withSill) w.set(x + dx, base(s) + 1, z + dz, ...sill(side))
}
}
// lantern hanging from the eave, outside the wall (needs the roof overhang above it)
B.lantern = (side, a) => { const [x, z] = wallCell(side, a); const [dx, dz] = OUT[side]; w.set(x + dx, top - 1, z + dz, 'lantern', { hanging: true }) }
// double door centred on cells a, a+1; the strip in front of it is removed
B.door = (side, a, s = 0, name = 'spruce_door') => {
const [dx, dz] = OUT[side]
;[a, a + 1].forEach((c, i) => {
const [x, z] = wallCell(side, c); const hinge = (i === 0) === (side === 'south' || side === 'west') ? 'left' : 'right'
w.set(x, base(s) + 1, z, name, { half: 'lower', facing: TOWARD[side], hinge }); w.set(x, base(s) + 2, z, name, { half: 'upper', facing: TOWARD[side], hinge })
w.set(x, base(s) + 3, z, ...beam(side === 'south' || side === 'north' ? 'x' : 'z'))
if (w.get(x + dx, base(s) + 1, z + dz).name.includes('copycat')) w.clear(x + dx, base(s) + 1, z + dz)
})
}
// big window in the gable with a copycat beam under it across the facade (call after R.finish())
B.gable = (side, { width = 4, rows = 3, pane = P.pane } = {}) => {
const [dx, dz] = OUT[side]; const [a1, a2] = span(side)
const c = Math.floor((a1 + a2 + 1) / 2) - width / 2
for (let a = c - 1; a <= c + width; a++) { const [x, z] = wallCell(side, a); if (air(w, x + dx, top, z + dz)) w.set(x + dx, top, z + dz, ...sill(side)) }
for (let i = 0; i < width; i++) for (let r = 1; r <= rows; r++) {
const [x, z] = wallCell(side, c + i)
if (w.get(x, top + r, z).name === P.wall) w.set(x, top + r, z, pane)
}
}
// straight stair along a wall from storey s to s+1: `x` fixed, starting at z = zFrom, rising toward -z or +z
B.stair = (s, x, zFrom, dir = -1) => {
const facing = dir < 0 ? 'north' : 'south'
for (let i = 0; i < STEP; i++) {
const z = zFrom + dir * i
w.set(x, base(s) + 1 + i, z, 'spruce_stairs', { facing, half: 'bottom', shape: 'straight' })
if (i > 0 && i < STEP - 1) w.clear(x, base(s + 1), z) // headroom; the top step itself sits in the floor plane
}
w.set(x, base(s + 1), zFrom + dir * STEP, P.upper)
}
return B
}
// spruce roof → dark oak barge boards at both ends and a rib every `step` blocks (the look of the user's roof)
function trimRoof (w, roofCells, { axis, from, to, step = 4 }) {
for (const k of roofCells) {
const [x, y, z] = k.split(',').map(Number); const r = axis === 'x' ? x : z
if (r < from || r > to) continue
if (r !== from && r !== to && (r - from) % step !== 0) continue
const b = w.get(x, y, z)
if (b.name.startsWith('spruce_')) w.set(x, y, z, b.name.replace('spruce_', 'dark_oak_'), b.props)
}
}
// steep (2:1) pyramid spire over the footprint, eaves one block out
function spire (w, x1, z1, x2, z2, top, { mat = 'spruce', edge = 'dark_oak' } = {}) {
const n = Math.floor((Math.min(x2 - x1, z2 - z1) + 3) / 2)
for (let k = 0; k < n; k++) {
const [a1, a2, c1, c2] = [x1 - 1 + k, x2 + 1 - k, z1 - 1 + k, z2 + 1 - k]
for (let x = a1; x <= a2; x++) for (let z = c1; z <= c2; z++) {
const nn = z === c1; const so = z === c2; const wd = x === a1; const e = x === a2
if (!(nn || so || wd || e)) continue
const m = (nn || so) && (wd || e) ? edge : mat // dark hips
if (k > 0) w.set(x, top + 2 * k - 1, z, m + '_planks')
w.set(x, top + 2 * k, z, m + '_stairs', { facing: nn ? 'south' : so ? 'north' : wd ? 'east' : 'west', half: 'bottom', shape: 'straight' })
}
}
return top + 2 * n - 1
}
// steps up to the platform in front of a door: cells a..b at z (south side)
function steps (w, a, b, z) { for (let x = a; x <= b; x++) w.set(x, 1, z, 'stone_brick_stairs', { facing: 'north', half: 'bottom', shape: 'straight' }) }
function finish (ctx, meta) {
ctx.w.connect()
return { world: ctx.w, meta: {
groundY: 0, interiors: ctx.interiors, rooms: ctx.rooms, ...meta,
views: [{ tag: 'front', rot: 0, elev: true, scale: 18 }, { tag: 'se', rot: 0, scale: 16 }, { tag: 'sw', rot: 1, scale: 16 }, { tag: 'nw', rot: 2, scale: 12 }]
} }
}
module.exports = { C, P, post, beam, strip, sill, column, STEP, OUT, TOWARD, start, body, trimRoof, spire, steps, finish }
+51
View File
@@ -0,0 +1,51 @@
// Типовий проект «Житловий будинок» (магазин держави, будівельні тендери): the state quarter's brick style on a
// family scale. 10 x 8, two storeys, gable roof with the ridge along the street; ground floor = kitchen and dining,
// upper floor = bedroom under the roof. The schematic starts at the plinth (y 1): the plot's ground is the buyer's.
const K = require('../civic/kit')
const { P } = K
function build () {
const ctx = K.start(); const { w, R } = ctx
const B = K.body(ctx, { x1: 3, z1: 4, x2: 12, z2: 11, storeys: 2, name: 'home' })
// front: double door in the middle, a window either side, three windows above
B.door('south', 7, 0); K.steps(w, 7, 8, 12)
for (const a of [4, 11]) { B.window('south', a, 0, { width: 1 }); B.window('south', a, 1, { width: 1 }) }
B.window('south', 7, 1)
for (const side of ['east', 'west']) { B.window(side, 7, 0); B.window(side, 7, 1) }
for (const a of [5, 10]) { B.window('north', a, 0, { width: 1 }); B.window('north', a, 1, { width: 1 }) }
for (const a of [4, 11]) B.lantern('south', a + (a === 4 ? 1 : -1))
// stair along the east wall, from the door side up toward the back
B.stair(0, 11, 10, -1)
for (let z = 6; z <= 9; z++) w.set(10, 7, z, 'dark_oak_fence') // rail along the stair hole
// ground floor: kitchen along the back wall, a table with chairs, lanterns under the upper floor
const kitchen = [['barrel', { facing: 'up' }], ['smoker', { facing: 'south' }], ['crafting_table'], ['water_cauldron', { level: 3 }], ['furnace', { facing: 'south' }]]
kitchen.forEach(([n, p], i) => w.set(4 + i, 2, 5, n, p || {}))
for (let x = 4; x <= 8; x++) w.set(x, 4, 5, 'spruce_trapdoor', { facing: 'south', half: 'top', open: false }) // shelf
w.set(5, 5, 5, 'flower_pot'); w.set(7, 5, 5, 'decorated_pot', { facing: 'south' })
w.set(5, 2, 8, 'dark_oak_fence'); w.set(5, 3, 8, 'dark_oak_pressure_plate')
w.set(6, 2, 8, 'dark_oak_fence'); w.set(6, 3, 8, 'dark_oak_pressure_plate')
w.set(4, 2, 8, 'spruce_stairs', { facing: 'west', half: 'bottom', shape: 'straight' })
w.set(7, 2, 8, 'spruce_stairs', { facing: 'east', half: 'bottom', shape: 'straight' })
for (const [x, z] of [[5, 7], [8, 9]]) w.set(x, 5, z, 'lantern', { hanging: true })
w.set(4, 2, 10, 'barrel', { facing: 'up' })
// upper floor: double bed with nightstands, chest, bookshelves, rug
for (const x of [4, 5]) { w.set(x, 7, 5, 'red_bed', { part: 'head', facing: 'north' }); w.set(x, 7, 6, 'red_bed', { part: 'foot', facing: 'north' }) }
w.set(6, 7, 5, 'barrel', { facing: 'up' }); w.set(6, 8, 5, 'lantern', { hanging: false })
w.set(4, 7, 10, 'chest', { facing: 'north' })
for (const x of [7, 8]) w.set(x, 7, 5, 'bookshelf')
w.set(8, 8, 5, 'lantern', { hanging: false })
for (let x = 4; x <= 8; x++) for (let z = 7; z <= 8; z++) w.set(x, 7, z, 'red_carpet')
w.set(9, 7, 10, 'lantern', { hanging: false })
R.gable(B.x1, B.z1, B.x2, B.z2, B.top, { axis: 'x', pitch: '1:1', overhang: 1, mat: 'spruce' })
const { roofCells, needCeiling } = R.finish(ctx.interiors)
K.trimRoof(w, roofCells, { axis: 'x', from: 2, to: 13, step: 4 })
B.gable('east', { width: 2, rows: 2 }); B.gable('west', { width: 2, rows: 2 })
return K.finish(ctx, { roofCells, needCeiling, entrance: { outside: [7, 2, 12], door: [7, 2, 11], side: 'south' },
reach: { kitchen: [6, 2, 6], table: [6, 2, 9], bed: [5, 7, 7], chest: [4, 7, 9] } })
}
module.exports = { build }
+72
View File
@@ -0,0 +1,72 @@
// Типовий проект «Залізнична станція» (магазин держави, будівельні тендери): a station building in the quarter's
// brick style, a platform 3 x 24 under a slab canopy on posts, and one straight Create track on ballast along it.
// The platform and the building's floor are one level (y 2), a step above the track bed, so a Create train's
// carriage floor lines up with the platform. The street is to the north (steps up to the waiting room), the track
// to the south. The train station block and signals are the owner's: they need a track network to link to.
// The schematic starts at y 1 (ballast and platform base); the plot's ground is the buyer's.
const K = require('../civic/kit')
const { C, P, post, beam } = K
const X1 = 0; const X2 = 23 // platform and track length
const stairs = (facing, mat = 'stone_brick', half = 'bottom') => [mat + '_stairs', { facing, half, shape: 'straight' }]
function build () {
const ctx = K.start(); const { w, R } = ctx
w.box(X1, 0, 0, X2, 0, 15, 'grass_block') // only for the renders: below the schematic
const B = K.body(ctx, { x1: 7, z1: 2, x2: 16, z2: 8, storeys: 1, y0: 2, name: 'waiting' })
// street side: steps up to a landing and the door into the waiting room
for (let x = 10; x <= 13; x++) { w.set(x, 1, 0, ...stairs('south')); w.set(x, 1, 1, P.plinth); w.set(x, 2, 1, P.plinth) }
for (let x = 10; x <= 13; x++) w.clear(x, 3, 1)
B.door('north', 11, 0)
for (const a of [8, 15]) B.window('north', a, 0, { width: 1 })
for (const side of ['east', 'west']) B.window(side, 5, 0, { width: 1 })
// platform side: a double door and the ticket window
B.door('south', 11, 0)
B.window('south', 8, 0, { width: 2 }); B.window('south', 14, 0, { width: 2 })
// platform z 9..11 at the floor level, a light edge stone along the track
for (let x = X1; x <= X2; x++) for (let z = 9; z <= 11; z++) {
w.set(x, 1, z, P.plinth); w.set(x, 2, z, z === 11 ? 'polished_andesite' : P.pave)
}
for (let x = 11; x <= 12; x++) w.clear(x, 3, 9) // the facade strip stays clear in front of the door
// ballast and the track
for (let x = X1; x <= X2; x++) {
for (let z = 12; z <= 14; z++) w.set(x, 1, z, 'gravel')
w.set(x, 2, 13, C('track'), { shape: 'xo', turn: false, waterlogged: false })
}
// canopy: posts on the building side of the platform, a beam, a slab roof reaching over the platform edge
const posts = [0, 4, 19, 23]
for (const x of posts) for (let y = 3; y <= 6; y++) w.set(x, y, 9, ...post)
// brackets under the cantilever: upside-down stairs from each post (and from the wall under the building)
for (const x of [...posts, B.x1, B.x2]) w.set(x, 5, 10, ...stairs('north', 'dark_oak', 'top'))
for (let x = X1; x <= X2; x++) {
const underBuilding = x >= B.x1 && x <= B.x2
if (!underBuilding && !posts.includes(x)) w.set(x, 6, 9, ...beam('x'))
for (let z = 10; z <= 11; z++) w.set(x, 6, z, 'spruce_slab', { type: 'top' })
w.set(x, 6, 12, 'dark_oak_slab', { type: 'top' })
if (underBuilding) w.set(x, 6, 9, 'spruce_slab', { type: 'top' })
}
for (const x of [2, 6, 10, 13, 17, 21]) w.set(x, 5, 10, 'lantern', { hanging: true })
// benches against the wall and the posts, facing the track
for (const x of [1, 2, 20, 21]) w.set(x, 3, 9, ...stairs('north', 'spruce'))
for (const x of [8, 9, 14, 15]) w.set(x, 3, 9, ...stairs('north', 'spruce'))
w.set(5, 3, 9, 'barrel', { facing: 'up' }); w.set(18, 3, 9, 'barrel', { facing: 'up' })
// waiting room: ticket counter of industrial iron, benches, the clock and lanterns
for (let x = 13; x <= 15; x++) w.set(x, 3, 6, P.iron)
w.set(15, 3, 4, 'lectern', { facing: 'west' }) // timetable
for (const x of [8, 9]) { w.set(x, 3, 4, ...stairs('south', 'spruce')); w.set(x, 3, 6, ...stairs('north', 'spruce')) }
w.set(13, 4, 6, 'lantern', { hanging: false }); w.set(10, 4, 3, 'lantern', { hanging: false }) // no ceiling: they stand
w.set(10, 3, 3, 'barrel', { facing: 'up' })
R.gable(B.x1, B.z1, B.x2, B.z2, B.top, { axis: 'x', pitch: '1:1', overhang: 1, mat: 'spruce' })
const { roofCells, needCeiling } = R.finish(ctx.interiors)
K.trimRoof(w, roofCells, { axis: 'x', from: 6, to: 17, step: 4 })
B.gable('east', { width: 2, rows: 2 }); B.gable('west', { width: 2, rows: 2 })
return K.finish(ctx, { roofCells, needCeiling, entrance: { outside: [11, 3, 0], door: [11, 3, 2], side: 'north' },
reach: { counter: [12, 3, 5], platform: [11, 3, 10], platformEnd: [22, 3, 10] } })
}
module.exports = { build }
+58
View File
@@ -0,0 +1,58 @@
// Типовий проект «Цех» (магазин держави, будівельні тендери): a small version of the state factory's hall.
// 14 x 14, one tall room (clear height 9) for machines, the gable to the street with a gate 4 x 5 in an iron frame,
// windows in two rows, girder trusses with lanterns. A workbench line along the west wall; the floor in the middle is
// left free for the owner's machinery. The schematic starts at the plinth (y 1).
const K = require('../civic/kit')
const { C, P, beam } = K
const stairs = (facing, mat) => [mat + '_stairs', { facing, half: 'bottom', shape: 'straight' }]
const girderX = [P.girder, { x: true, z: false, top: false, bottom: false }]
function build () {
const ctx = K.start(); const { w, R } = ctx
const B = K.body(ctx, { x1: 1, z1: 1, x2: 14, z2: 14, storeys: 2, name: 'hall', floor: 'smooth_stone', facade: ['south', 'north'] })
w.box(2, 6, 2, 13, 6, 13, 'air') // one tall room, no upper floor
ctx.rooms.length = 1; ctx.interiors.length = 0; ctx.interiors.push([2, 2, 2, 13, 10, 13])
// gate: 4 wide, 5 high, industrial iron frame, girder lintel; a ramp in front instead of steps
for (let x = 6; x <= 9; x++) {
for (let y = 2; y <= 6; y++) w.clear(x, y, 14)
w.clear(x, 2, 15); w.set(x, 1, 15, ...stairs('north', 'stone_brick')); w.set(x, 7, 14, ...girderX)
}
for (const x of [5, 10]) for (let y = 2; y <= 7; y++) w.set(x, y, 14, P.iron)
for (const a of [2, 12]) { B.window('south', a, 0, { width: 2 }); B.window('south', a, 1, { width: 2 }) }
// back door and windows
B.door('north', 7, 0); for (let x = 7; x <= 8; x++) w.set(x, 1, 0, ...stairs('south', 'stone_brick'))
for (const a of [3, 11]) { B.window('north', a, 0); B.window('north', a, 1) }
// long sides: two rows of windows in three bays, lanterns under the eaves
for (const side of ['east', 'west']) {
for (const a of [3, 7, 11]) { B.window(side, a, 0); B.window(side, a, 1) }
for (const a of [5, 10]) B.lantern(side, a)
}
// trusses: girders across the hall, lanterns hanging from them
for (const z of [4, 8, 12]) {
for (let x = 2; x <= 13; x++) w.set(x, 10, z, ...girderX)
for (const x of [5, 10]) w.set(x, 9, z, 'lantern', { hanging: true })
}
// workbench line along the west wall: tools on an andesite casing counter
const bench = [['crafting_table'], ['smithing_table'], ['stonecutter', { facing: 'east' }], ['anvil', { facing: 'north' }], ['grindstone', { face: 'floor', facing: 'east' }],
[C('andesite_casing')], [C('andesite_casing')], ['barrel', { facing: 'up' }], ['barrel', { facing: 'up' }]]
bench.forEach(([n, p], i) => w.set(2, 2, 3 + i, n, p || {}))
for (const z of [8, 9]) w.set(2, 3, z, C('depot'))
w.set(2, 3, 10, 'barrel', { facing: 'up' })
// storage corner by the back door: chests and a toolbox
for (const x of [11, 12]) w.set(x, 2, 2, 'chest', { facing: 'south' })
w.set(13, 2, 2, C('brown_toolbox'), { facing: 'south' })
w.set(13, 2, 4, 'barrel', { facing: 'up' }); w.set(13, 2, 5, 'barrel', { facing: 'up' })
R.gable(B.x1, B.z1, B.x2, B.z2, B.top, { axis: 'z', pitch: '1:1', overhang: 1, mat: 'spruce' })
const { roofCells, needCeiling } = R.finish(ctx.interiors)
K.trimRoof(w, roofCells, { axis: 'z', from: 0, to: 15, step: 4 })
B.gable('south', { width: 4, rows: 3 }); B.gable('north', { width: 4, rows: 3 })
return K.finish(ctx, { roofCells, needCeiling, entrance: { outside: [7, 2, 15], door: [7, 2, 14], side: 'south' },
reach: { bench: [3, 2, 6], storage: [12, 2, 3], backdoor: [7, 2, 2] } })
}
module.exports = { build }