nucleation 0.10.22 → 0.10.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/Schematic.d.mts +23 -0
- package/Schematic.d.ts +23 -0
- package/Schematic.mjs +70 -0
- package/nucleation.wasm +0 -0
- package/package.json +7 -2
- package/renderer/AnimationEffect.d.mts +44 -0
- package/renderer/AnimationEffect.d.ts +44 -0
- package/renderer/AnimationEffect.mjs +204 -0
- package/renderer/Autostack.d.mts +43 -0
- package/renderer/Autostack.d.ts +43 -0
- package/renderer/Autostack.mjs +134 -0
- package/renderer/BlockPos.d.mts +28 -0
- package/renderer/BlockPos.d.ts +28 -0
- package/renderer/BlockPos.mjs +130 -0
- package/renderer/BlockState.d.mts +39 -0
- package/renderer/BlockState.d.ts +39 -0
- package/renderer/BlockState.mjs +134 -0
- package/renderer/Blocks.d.mts +91 -0
- package/renderer/Blocks.d.ts +91 -0
- package/renderer/Blocks.mjs +308 -0
- package/renderer/Brush.d.mts +99 -0
- package/renderer/Brush.d.ts +99 -0
- package/renderer/Brush.mjs +335 -0
- package/renderer/BuildAnimation.d.mts +179 -0
- package/renderer/BuildAnimation.d.ts +179 -0
- package/renderer/BuildAnimation.mjs +1148 -0
- package/renderer/BuildingTool.d.mts +46 -0
- package/renderer/BuildingTool.d.ts +46 -0
- package/renderer/BuildingTool.mjs +121 -0
- package/renderer/CellExecutor.d.mts +51 -0
- package/renderer/CellExecutor.d.ts +51 -0
- package/renderer/CellExecutor.mjs +171 -0
- package/renderer/CellularSdfConfig.d.mts +22 -0
- package/renderer/CellularSdfConfig.d.ts +22 -0
- package/renderer/CellularSdfConfig.mjs +69 -0
- package/renderer/ChunkMeshResult.d.mts +75 -0
- package/renderer/ChunkMeshResult.d.ts +75 -0
- package/renderer/ChunkMeshResult.mjs +253 -0
- package/renderer/CircuitBuilder.d.mts +118 -0
- package/renderer/CircuitBuilder.d.ts +118 -0
- package/renderer/CircuitBuilder.mjs +516 -0
- package/renderer/Curve3D.d.mts +27 -0
- package/renderer/Curve3D.d.ts +27 -0
- package/renderer/Curve3D.mjs +101 -0
- package/renderer/DefinitionRegion.d.mts +274 -0
- package/renderer/DefinitionRegion.d.ts +274 -0
- package/renderer/DefinitionRegion.mjs +973 -0
- package/renderer/Design.d.mts +348 -0
- package/renderer/Design.d.ts +348 -0
- package/renderer/Design.mjs +1334 -0
- package/renderer/Diff.d.mts +88 -0
- package/renderer/Diff.d.ts +88 -0
- package/renderer/Diff.mjs +316 -0
- package/renderer/Dimensions.d.mts +28 -0
- package/renderer/Dimensions.d.ts +28 -0
- package/renderer/Dimensions.mjs +130 -0
- package/renderer/DistanceField.d.mts +39 -0
- package/renderer/DistanceField.d.ts +39 -0
- package/renderer/DistanceField.mjs +114 -0
- package/renderer/ExecutionMode.d.mts +42 -0
- package/renderer/ExecutionMode.d.ts +42 -0
- package/renderer/ExecutionMode.mjs +127 -0
- package/renderer/Field3.d.mts +40 -0
- package/renderer/Field3.d.ts +40 -0
- package/renderer/Field3.mjs +160 -0
- package/renderer/FieldProgram.d.mts +40 -0
- package/renderer/FieldProgram.d.ts +40 -0
- package/renderer/FieldProgram.mjs +167 -0
- package/renderer/FieldProgramBinaryOp.d.mts +42 -0
- package/renderer/FieldProgramBinaryOp.d.ts +42 -0
- package/renderer/FieldProgramBinaryOp.mjs +118 -0
- package/renderer/FieldProgramBuilder.d.mts +104 -0
- package/renderer/FieldProgramBuilder.d.ts +104 -0
- package/renderer/FieldProgramBuilder.mjs +486 -0
- package/renderer/FieldProgramDistanceKind.d.mts +26 -0
- package/renderer/FieldProgramDistanceKind.d.ts +26 -0
- package/renderer/FieldProgramDistanceKind.mjs +78 -0
- package/renderer/FieldProgramUnaryOp.d.mts +34 -0
- package/renderer/FieldProgramUnaryOp.d.ts +34 -0
- package/renderer/FieldProgramUnaryOp.mjs +102 -0
- package/renderer/FieldProgramValueType.d.mts +25 -0
- package/renderer/FieldProgramValueType.d.ts +25 -0
- package/renderer/FieldProgramValueType.mjs +75 -0
- package/renderer/FieldRange.d.mts +15 -0
- package/renderer/FieldRange.d.ts +15 -0
- package/renderer/FieldRange.mjs +109 -0
- package/renderer/Fingerprint.d.mts +44 -0
- package/renderer/Fingerprint.d.ts +44 -0
- package/renderer/Fingerprint.mjs +197 -0
- package/renderer/GeneratedChunk.d.mts +35 -0
- package/renderer/GeneratedChunk.d.ts +35 -0
- package/renderer/GeneratedChunk.mjs +178 -0
- package/renderer/GeneratedChunkCoverage.d.mts +25 -0
- package/renderer/GeneratedChunkCoverage.d.ts +25 -0
- package/renderer/GeneratedChunkCoverage.mjs +75 -0
- package/renderer/GeneratedChunkOverlayMode.d.mts +24 -0
- package/renderer/GeneratedChunkOverlayMode.d.ts +24 -0
- package/renderer/GeneratedChunkOverlayMode.mjs +72 -0
- package/renderer/GeneratedWorldStream.d.mts +28 -0
- package/renderer/GeneratedWorldStream.d.ts +28 -0
- package/renderer/GeneratedWorldStream.mjs +86 -0
- package/renderer/Geo.d.mts +41 -0
- package/renderer/Geo.d.ts +41 -0
- package/renderer/Geo.mjs +121 -0
- package/renderer/Hdl.d.mts +56 -0
- package/renderer/Hdl.d.ts +56 -0
- package/renderer/Hdl.mjs +163 -0
- package/renderer/InterpolationSpace.d.mts +25 -0
- package/renderer/InterpolationSpace.d.ts +25 -0
- package/renderer/InterpolationSpace.mjs +73 -0
- package/renderer/IoLayout.d.mts +26 -0
- package/renderer/IoLayout.d.ts +26 -0
- package/renderer/IoLayout.mjs +81 -0
- package/renderer/IoLayoutBuilder.d.mts +73 -0
- package/renderer/IoLayoutBuilder.d.ts +73 -0
- package/renderer/IoLayoutBuilder.mjs +315 -0
- package/renderer/IoType.d.mts +41 -0
- package/renderer/IoType.d.ts +41 -0
- package/renderer/IoType.mjs +125 -0
- package/renderer/ItemModelConfig.d.mts +65 -0
- package/renderer/ItemModelConfig.d.ts +65 -0
- package/renderer/ItemModelConfig.mjs +223 -0
- package/renderer/ItemModelPackBuilder.d.mts +32 -0
- package/renderer/ItemModelPackBuilder.d.ts +32 -0
- package/renderer/ItemModelPackBuilder.mjs +104 -0
- package/renderer/ItemModelResult.d.mts +72 -0
- package/renderer/ItemModelResult.d.ts +72 -0
- package/renderer/ItemModelResult.mjs +268 -0
- package/renderer/ItemScale.d.mts +31 -0
- package/renderer/ItemScale.d.ts +31 -0
- package/renderer/ItemScale.mjs +133 -0
- package/renderer/LayoutFunction.d.mts +52 -0
- package/renderer/LayoutFunction.d.ts +52 -0
- package/renderer/LayoutFunction.mjs +159 -0
- package/renderer/MchprsWorld.d.mts +131 -0
- package/renderer/MchprsWorld.d.ts +131 -0
- package/renderer/MchprsWorld.mjs +423 -0
- package/renderer/MeshBounds.d.mts +40 -0
- package/renderer/MeshBounds.d.ts +40 -0
- package/renderer/MeshBounds.mjs +181 -0
- package/renderer/MeshConfig.d.mts +101 -0
- package/renderer/MeshConfig.d.ts +101 -0
- package/renderer/MeshConfig.mjs +306 -0
- package/renderer/MeshJob.d.mts +44 -0
- package/renderer/MeshJob.d.ts +44 -0
- package/renderer/MeshJob.mjs +116 -0
- package/renderer/MeshPhase.d.mts +38 -0
- package/renderer/MeshPhase.d.ts +38 -0
- package/renderer/MeshPhase.mjs +90 -0
- package/renderer/MeshProgress.d.mts +32 -0
- package/renderer/MeshProgress.d.ts +32 -0
- package/renderer/MeshProgress.mjs +134 -0
- package/renderer/MeshResult.d.mts +76 -0
- package/renderer/MeshResult.d.ts +76 -0
- package/renderer/MeshResult.mjs +269 -0
- package/renderer/MultiMeshResult.d.mts +50 -0
- package/renderer/MultiMeshResult.d.ts +50 -0
- package/renderer/MultiMeshResult.mjs +166 -0
- package/renderer/Nbt.d.mts +50 -0
- package/renderer/Nbt.d.ts +50 -0
- package/renderer/Nbt.mjs +161 -0
- package/renderer/NucleationError.d.mts +53 -0
- package/renderer/NucleationError.d.ts +53 -0
- package/renderer/NucleationError.mjs +136 -0
- package/renderer/OutputCondition.d.mts +45 -0
- package/renderer/OutputCondition.d.ts +45 -0
- package/renderer/OutputCondition.mjs +129 -0
- package/renderer/Palette.d.mts +157 -0
- package/renderer/Palette.d.ts +157 -0
- package/renderer/Palette.mjs +487 -0
- package/renderer/PaletteBuilder.d.mts +119 -0
- package/renderer/PaletteBuilder.d.ts +119 -0
- package/renderer/PaletteBuilder.mjs +457 -0
- package/renderer/README.md +67 -0
- package/renderer/RawMeshExport.d.mts +74 -0
- package/renderer/RawMeshExport.d.ts +74 -0
- package/renderer/RawMeshExport.mjs +243 -0
- package/renderer/RedstoneGraph.d.mts +58 -0
- package/renderer/RedstoneGraph.d.ts +58 -0
- package/renderer/RedstoneGraph.mjs +242 -0
- package/renderer/RegionBounds.d.mts +41 -0
- package/renderer/RegionBounds.d.ts +41 -0
- package/renderer/RegionBounds.mjs +182 -0
- package/renderer/RenderConfig.d.mts +101 -0
- package/renderer/RenderConfig.d.ts +101 -0
- package/renderer/RenderConfig.mjs +271 -0
- package/renderer/Renderer.d.mts +51 -0
- package/renderer/Renderer.d.ts +51 -0
- package/renderer/Renderer.mjs +219 -0
- package/renderer/ResourcePack.d.mts +105 -0
- package/renderer/ResourcePack.d.ts +105 -0
- package/renderer/ResourcePack.mjs +447 -0
- package/renderer/ResourcePackList.d.mts +32 -0
- package/renderer/ResourcePackList.d.ts +32 -0
- package/renderer/ResourcePackList.mjs +96 -0
- package/renderer/Routing.d.mts +66 -0
- package/renderer/Routing.d.ts +66 -0
- package/renderer/Routing.mjs +220 -0
- package/renderer/Schematic.d.mts +977 -0
- package/renderer/Schematic.d.ts +977 -0
- package/renderer/Schematic.mjs +3820 -0
- package/renderer/SchematicBuilder.d.mts +103 -0
- package/renderer/SchematicBuilder.d.ts +103 -0
- package/renderer/SchematicBuilder.mjs +401 -0
- package/renderer/SchematicRegions.d.mts +93 -0
- package/renderer/SchematicRegions.d.ts +93 -0
- package/renderer/SchematicRegions.mjs +411 -0
- package/renderer/SchematicSplitResult.d.mts +26 -0
- package/renderer/SchematicSplitResult.d.ts +26 -0
- package/renderer/SchematicSplitResult.mjs +84 -0
- package/renderer/Scripting.d.mts +40 -0
- package/renderer/Scripting.d.ts +40 -0
- package/renderer/Scripting.mjs +138 -0
- package/renderer/Sdf.d.mts +234 -0
- package/renderer/Sdf.d.ts +234 -0
- package/renderer/Sdf.mjs +1234 -0
- package/renderer/SdfAxis.d.mts +25 -0
- package/renderer/SdfAxis.d.ts +25 -0
- package/renderer/SdfAxis.mjs +75 -0
- package/renderer/SdfBounds.d.mts +19 -0
- package/renderer/SdfBounds.d.ts +19 -0
- package/renderer/SdfBounds.mjs +161 -0
- package/renderer/SdfCellMode.d.mts +26 -0
- package/renderer/SdfCellMode.d.ts +26 -0
- package/renderer/SdfCellMode.mjs +78 -0
- package/renderer/SdfNormal.d.mts +16 -0
- package/renderer/SdfNormal.d.ts +16 -0
- package/renderer/SdfNormal.mjs +122 -0
- package/renderer/Shape.d.mts +143 -0
- package/renderer/Shape.d.ts +143 -0
- package/renderer/Shape.mjs +458 -0
- package/renderer/SortStrategy.d.mts +86 -0
- package/renderer/SortStrategy.d.ts +86 -0
- package/renderer/SortStrategy.mjs +272 -0
- package/renderer/Store.d.mts +83 -0
- package/renderer/Store.d.ts +83 -0
- package/renderer/Store.mjs +369 -0
- package/renderer/StoreIo.d.mts +71 -0
- package/renderer/StoreIo.d.ts +71 -0
- package/renderer/StoreIo.mjs +292 -0
- package/renderer/TextureAtlas.d.mts +40 -0
- package/renderer/TextureAtlas.d.ts +40 -0
- package/renderer/TextureAtlas.mjs +122 -0
- package/renderer/TextureInfo.d.mts +34 -0
- package/renderer/TextureInfo.d.ts +34 -0
- package/renderer/TextureInfo.mjs +149 -0
- package/renderer/TickSettleMode.d.mts +34 -0
- package/renderer/TickSettleMode.d.ts +34 -0
- package/renderer/TickSettleMode.mjs +84 -0
- package/renderer/TickSimulation.d.mts +572 -0
- package/renderer/TickSimulation.d.ts +572 -0
- package/renderer/TickSimulation.mjs +1299 -0
- package/renderer/TypedCircuitExecutor.d.mts +101 -0
- package/renderer/TypedCircuitExecutor.d.ts +101 -0
- package/renderer/TypedCircuitExecutor.mjs +378 -0
- package/renderer/Value.d.mts +73 -0
- package/renderer/Value.d.ts +73 -0
- package/renderer/Value.mjs +275 -0
- package/renderer/VideoConfig.d.mts +15 -0
- package/renderer/VideoConfig.d.ts +15 -0
- package/renderer/VideoConfig.mjs +44 -0
- package/renderer/VoxelModel.d.mts +34 -0
- package/renderer/VoxelModel.d.ts +34 -0
- package/renderer/VoxelModel.mjs +113 -0
- package/renderer/Voxelizer.d.mts +80 -0
- package/renderer/Voxelizer.d.ts +80 -0
- package/renderer/Voxelizer.mjs +261 -0
- package/renderer/WorldChunkView.d.mts +75 -0
- package/renderer/WorldChunkView.d.ts +75 -0
- package/renderer/WorldChunkView.mjs +224 -0
- package/renderer/WorldGenerator.d.mts +75 -0
- package/renderer/WorldGenerator.d.ts +75 -0
- package/renderer/WorldGenerator.mjs +255 -0
- package/renderer/WorldSink.d.mts +50 -0
- package/renderer/WorldSink.d.ts +50 -0
- package/renderer/WorldSink.mjs +177 -0
- package/renderer/WorldStream.d.mts +45 -0
- package/renderer/WorldStream.d.ts +45 -0
- package/renderer/WorldStream.mjs +184 -0
- package/renderer/WsPartitionHints.d.mts +29 -0
- package/renderer/WsPartitionHints.d.ts +29 -0
- package/renderer/WsPartitionHints.mjs +102 -0
- package/renderer/WsProfile.d.mts +46 -0
- package/renderer/WsProfile.d.ts +46 -0
- package/renderer/WsProfile.mjs +152 -0
- package/renderer/WsRunResult.d.mts +83 -0
- package/renderer/WsRunResult.d.ts +83 -0
- package/renderer/WsRunResult.mjs +326 -0
- package/renderer/WsSegmentJob.d.mts +28 -0
- package/renderer/WsSegmentJob.d.ts +28 -0
- package/renderer/WsSegmentJob.mjs +81 -0
- package/renderer/diplomat-runtime.d.mts +15 -0
- package/renderer/diplomat-runtime.d.ts +15 -0
- package/renderer/diplomat-runtime.mjs +779 -0
- package/renderer/diplomat-wasm.mjs +52 -0
- package/renderer/diplomat.config.mjs +5 -0
- package/renderer/index.d.mts +193 -0
- package/renderer/index.d.ts +193 -0
- package/renderer/index.mjs +196 -0
- package/renderer/nucleation.wasm +0 -0
- package/renderer/veneer/design.d.ts +167 -0
- package/renderer/veneer/design.mjs +480 -0
|
@@ -0,0 +1,572 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { NucleationError } from "./NucleationError.mjs"
|
|
3
|
+
import type { Schematic } from "./Schematic.mjs"
|
|
4
|
+
import type { TickSettleMode } from "./TickSettleMode.mjs"
|
|
5
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A headless, vanilla-accurate tick simulation of one structure.
|
|
11
|
+
*/
|
|
12
|
+
export class TickSimulation {
|
|
13
|
+
/** @internal */
|
|
14
|
+
get ffiValue(): pointer;
|
|
15
|
+
/** @internal */
|
|
16
|
+
constructor();
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Why the last constructor on this thread failed, in words.
|
|
21
|
+
*
|
|
22
|
+
* The enum cannot carry a message, and "Simulation" is useless to
|
|
23
|
+
* someone holding a door that will not load: the engine already knows
|
|
24
|
+
* it is `minecraft:waxed_copper_bulb` at (4,2,1) and says so here.
|
|
25
|
+
* Empty when the last construction succeeded.
|
|
26
|
+
*/
|
|
27
|
+
static lastErrorDetail(): string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Largest build this will attempt, in cells.
|
|
31
|
+
*
|
|
32
|
+
* A 500x379x442 "door" is a saved world, and loading one exhausts the
|
|
33
|
+
* wasm heap — after which every later call on that instance traps,
|
|
34
|
+
* not just the one that overflowed. Refused up front instead.
|
|
35
|
+
*/
|
|
36
|
+
static maxVolume(): number;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Load from Java structure SNBT text.
|
|
40
|
+
*
|
|
41
|
+
* `extra_states`: semicolon-separated block-state descriptors that
|
|
42
|
+
* later `place_block` calls may write (behaviours bind at
|
|
43
|
+
* construction). `minecraft:redstone_block` is always available.
|
|
44
|
+
* `origin_*`: where the build's (0,0,0) sits in world coordinates —
|
|
45
|
+
* wire update order hashes absolute positions.
|
|
46
|
+
*
|
|
47
|
+
* The text's own `DataVersion` selects `Entity.load` Motion semantics,
|
|
48
|
+
* exactly as {@link TickSimulation::from_schematic} uses the schematic's —
|
|
49
|
+
* so `gametest_snbt` → `from_snbt` keeps a nan-cart build's NaN
|
|
50
|
+
* velocities instead of quietly sanitising them. A text with no
|
|
51
|
+
* `DataVersion` gets the engine default (the modern, NaN-dropping
|
|
52
|
+
* rule); read {@link TickSimulation::motion_semantics} to see which
|
|
53
|
+
* applied.
|
|
54
|
+
*/
|
|
55
|
+
static fromSnbt(snbt: string, settle: TickSettleMode, originX: number, originY: number, originZ: number, extraStates: string): TickSimulation;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Load from a schematic (any format nucleation can read), rendered
|
|
59
|
+
* to gametest-flavor structure SNBT for mc-tick's parser.
|
|
60
|
+
*/
|
|
61
|
+
static fromSchematic(schematic: Schematic, settle: TickSettleMode, originX: number, originY: number, originZ: number, extraStates: string): TickSimulation;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* GA fast path: construct from a flat genome-cell array — no SNBT
|
|
65
|
+
* text built or parsed. Corridor layout matches the flying-ga app:
|
|
66
|
+
* machine at `x_off`, world size `[bx + travel, by + 2, bz + 2]`,
|
|
67
|
+
* cells flattened `((y * bz) + z) * bx + x`, `air_index` = empty
|
|
68
|
+
* cell. `palette` is the run's alphabet, semicolon-separated; every
|
|
69
|
+
* entry is pre-interned so behaviours bind exactly as the SNBT
|
|
70
|
+
* path's EXTRA_STATES did.
|
|
71
|
+
*/
|
|
72
|
+
static fromBlocks(bx: number, by: number, bz: number, travel: number, xOff: number, palette: string, cells: Array<number>, airIndex: number, settle: TickSettleMode, originX: number, originY: number, originZ: number): TickSimulation;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Evaluate a whole batch of kicked flights inside the engine — one
|
|
76
|
+
* wasm call per generation chunk instead of a dozen boundary calls
|
|
77
|
+
* per machine. `cells` holds N genomes concatenated (each
|
|
78
|
+
* `bx*by*bz` entries), `kicks` N structure-space `[x,y,z]` triples.
|
|
79
|
+
* The flight protocol, probe schedule and gait detection mirror the
|
|
80
|
+
* app's evalCore exactly; `early_exit` stops provably-frozen
|
|
81
|
+
* machines at tick 40 without changing any reported value. Writes
|
|
82
|
+
* JSON rows `[n0, startCom, startMinX, startMaxX, comAtMoveCheck |
|
|
83
|
+
* null, comAtMid, period, n1, endCom, endMinX, endMaxX]`.
|
|
84
|
+
*/
|
|
85
|
+
static evalFlightBatch(bx: number, by: number, bz: number, travel: number, xOff: number, palette: string, cells: Array<number>, airIndex: number, kicks: Array<number>, evalTicks: number, seed: bigint, mustMoveByTick: number, needPeriod: boolean, earlyExit: boolean): string;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Seed the vanilla random source (`java.util.Random`'s LCG,
|
|
89
|
+
* bit-for-bit). Unseeded, jittering behaviours use each
|
|
90
|
+
* distribution's mean — fully deterministic, no noise.
|
|
91
|
+
*/
|
|
92
|
+
setRngSeed(seed: bigint): void;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Advance one game tick.
|
|
96
|
+
*/
|
|
97
|
+
step(): void;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Advance `ticks` game ticks.
|
|
101
|
+
*/
|
|
102
|
+
run(ticks: number): void;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Run until nothing is scheduled or `budget` ticks pass. Returns
|
|
106
|
+
* whether the world went quiet.
|
|
107
|
+
*/
|
|
108
|
+
runUntilQuiescent(budget: number): boolean;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Game ticks elapsed since settle.
|
|
112
|
+
*/
|
|
113
|
+
tickCount(): number;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Whether nothing is scheduled or queued.
|
|
117
|
+
*/
|
|
118
|
+
isQuiescent(): boolean;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Right-click a block with an empty hand (lever, button, note block).
|
|
122
|
+
*/
|
|
123
|
+
useBlock(x: number, y: number, z: number): void;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Write a block state (`minecraft:air` breaks). The state must be in
|
|
127
|
+
* the structure, in `extra_states`, or `minecraft:redstone_block`.
|
|
128
|
+
*/
|
|
129
|
+
placeBlock(x: number, y: number, z: number, state: string): void;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* The block state descriptor at a position (`minecraft:air` for empty).
|
|
133
|
+
*/
|
|
134
|
+
getBlock(x: number, y: number, z: number): string;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Batched block-state reads: `positions_json` is `[[x,y,z], ...]`,
|
|
138
|
+
* the answer a JSON array of descriptors in the same order
|
|
139
|
+
* (`"minecraft:air"` for empty).
|
|
140
|
+
*
|
|
141
|
+
* A verification sweep over a computational build is thousands of
|
|
142
|
+
* probe reads per settle; one boundary call per sweep instead of one
|
|
143
|
+
* per probe is the difference between the FFI being the throughput
|
|
144
|
+
* ceiling and not.
|
|
145
|
+
*/
|
|
146
|
+
readProbes(positionsJson: string): string;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Who powers this cell and why — a power-source tree from the
|
|
150
|
+
* simulation's current state, as JSON.
|
|
151
|
+
*
|
|
152
|
+
* Each node carries `pos`, `state`, `kind` (`wire` / `conductor` /
|
|
153
|
+
* `source` / `block`), the `power` the cell carries or emits, and
|
|
154
|
+
* `inputs`: the per-side contributions that explain it, each with a
|
|
155
|
+
* `mechanism` (`block_signal`, `wire`, `wire_up`, `wire_down`,
|
|
156
|
+
* `strong`, `signal`), the arriving `power`, and a recursive
|
|
157
|
+
* `source` node. Cycles stop with `"cycle": true`. Coordinates are
|
|
158
|
+
* the same structure-local space `get_block` reads.
|
|
159
|
+
*
|
|
160
|
+
* This is the static complement of running the sim: an open (a dead
|
|
161
|
+
* route that settles quiescent) shows up as an empty `inputs` list
|
|
162
|
+
* exactly where the feed should have been.
|
|
163
|
+
*/
|
|
164
|
+
conductionTrace(x: number, y: number, z: number): string;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Write every settled non-air state back into `schematic` — the bulk
|
|
168
|
+
* form of `{simulate=true}`: settle once, keep the world the engine
|
|
169
|
+
* ended on. Returns how many blocks changed.
|
|
170
|
+
*
|
|
171
|
+
* The schematic's bounding-box minimum corresponds to the
|
|
172
|
+
* simulation's `(0, 0, 0)`, which is exactly how `from_schematic`
|
|
173
|
+
* loaded it. A file baked this way carries real wire connections and
|
|
174
|
+
* power in its palette, loads quiescent under `InWorld`, and renders
|
|
175
|
+
* correctly in any static consumer. Cells the simulation turned into
|
|
176
|
+
* air (a popped-off component) are left as the schematic had them.
|
|
177
|
+
*/
|
|
178
|
+
bakeTo(schematic: Schematic): number;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Snapshot the entire simulation; returns a checkpoint id.
|
|
182
|
+
*/
|
|
183
|
+
checkpoint(): number;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Restore a checkpoint taken earlier on this simulation.
|
|
187
|
+
*/
|
|
188
|
+
restore(id: number): void;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Render a schematic as gametest-flavor structure SNBT — the text
|
|
192
|
+
* `from_snbt` and the corpus/render tooling consume. Lets hosts hand
|
|
193
|
+
* a converted `.litematic`/`.schem` to the video renderer.
|
|
194
|
+
*/
|
|
195
|
+
static gametestSnbt(schematic: Schematic): string;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Report blocks whose behaviour is defined by block-entity data the
|
|
199
|
+
* file does not carry.
|
|
200
|
+
*
|
|
201
|
+
* Some exporters write the blocks and drop the block entities. The
|
|
202
|
+
* build then loads clean and simulates *wrongly but plausibly*: a
|
|
203
|
+
* comparator with no `OutputSignal` reads 0, a barrel holding the
|
|
204
|
+
* item that latched a repeater reads empty, and the door quietly
|
|
205
|
+
* fails to reset. Two files with identical block arrays get
|
|
206
|
+
* different verdicts and nothing says why. `0.45_4x4_funnel.schem`
|
|
207
|
+
* is exactly this — 4 comparators, 2 furnaces, `BlockEntities` of
|
|
208
|
+
* length 0, while its `.litematic` twin carries all 9.
|
|
209
|
+
*
|
|
210
|
+
* This does not refuse the build; it names the doubt so a host can.
|
|
211
|
+
* JSON: `{"present":N,"missing_total":N,"missing":[{"name":..,
|
|
212
|
+
* "count":N}],"summary":"..."}` — `summary` is empty when nothing
|
|
213
|
+
* is missing, and otherwise a sentence fit to show as-is.
|
|
214
|
+
*/
|
|
215
|
+
static blockEntityAuditJson(schematic: Schematic): string;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Start (or stop) recording every delivered redstone update.
|
|
219
|
+
*
|
|
220
|
+
* Off by default and much larger than the block-change log — a door's
|
|
221
|
+
* cycle runs several updates per change — so a propagation view asks
|
|
222
|
+
* for it explicitly and pages with
|
|
223
|
+
* {@link TickSimulation::updates_json_between}.
|
|
224
|
+
*
|
|
225
|
+
* Switching it off keeps what was recorded; use
|
|
226
|
+
* {@link TickSimulation::clear_updates} to free it.
|
|
227
|
+
*/
|
|
228
|
+
recordUpdates(on: boolean): void;
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Drop the recorded updates without changing whether recording is on.
|
|
232
|
+
*
|
|
233
|
+
* A cycle of a 6x6 door is tens of megabytes of log, so a page that
|
|
234
|
+
* certifies several builds on one instance needs to release one
|
|
235
|
+
* before recording the next.
|
|
236
|
+
*/
|
|
237
|
+
clearUpdates(): void;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Start recording a run timeline from the current tick.
|
|
241
|
+
*
|
|
242
|
+
* A timeline is what makes a span of simulation reviewable after the
|
|
243
|
+
* fact: block deltas, the inputs that caused them and the piston
|
|
244
|
+
* strokes they drove, plus one whole-world frame to replay them from.
|
|
245
|
+
* Off by default — a simulation used for timing should not pay for it.
|
|
246
|
+
*
|
|
247
|
+
* Called again, it restarts from the current tick, and the previously
|
|
248
|
+
* stopped span is released.
|
|
249
|
+
*
|
|
250
|
+
* Starting a recording also wipes the plain block-change log that
|
|
251
|
+
* {@link TickSimulation::changes_json} and {@link TickSimulation::changes_count}
|
|
252
|
+
* read back to empty — a separate reset from
|
|
253
|
+
* {@link TickSimulation::record_updates}/{@link TickSimulation::clear_updates},
|
|
254
|
+
* which govern a different log. A host holding a cursor into the
|
|
255
|
+
* change log (the sim lab keeps a cumulative one) must reset that
|
|
256
|
+
* cursor when it calls this, or it will read past the end of a log
|
|
257
|
+
* that is no longer the one it was walking.
|
|
258
|
+
*/
|
|
259
|
+
recordTimeline(): void;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* End the recording, keeping the span readable.
|
|
263
|
+
*
|
|
264
|
+
* This is a host's Stop button, and it is not a rewind: the span stays
|
|
265
|
+
* readable and exportable until the next
|
|
266
|
+
* {@link TickSimulation::record_timeline}, while the simulation is free to
|
|
267
|
+
* run on without the recording following it. No-op if nothing was
|
|
268
|
+
* recording.
|
|
269
|
+
*/
|
|
270
|
+
stopTimeline(): void;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Where the recorded run was busy, as JSON:
|
|
274
|
+
* `{"start":T,"end":T,"ticks":[{"tick":T,"changes":N,"inputs":N,
|
|
275
|
+
* "pistons":N}]}`.
|
|
276
|
+
*
|
|
277
|
+
* The strip a host draws to let someone pick a span worth exporting.
|
|
278
|
+
* Only ticks that did something appear: an idle tick is **absent**
|
|
279
|
+
* rather than present with zeroes, so a build that sits still does not
|
|
280
|
+
* advance the strip and a long quiet run stays cheap to send.
|
|
281
|
+
*
|
|
282
|
+
* `{"start":0,"end":0,"ticks":[]}` when nothing has been recorded.
|
|
283
|
+
*/
|
|
284
|
+
timelineActivityJson(): string;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Exact and translated recurrence in the timeline a read query would
|
|
288
|
+
* resolve to (see {@link Self::timeline}), as JSON:
|
|
289
|
+
* `{"exact":{"start":T,"end":T,"period":N,"drift":[x,y,z]}|null,
|
|
290
|
+
* "translated":{...}|null}`.
|
|
291
|
+
*
|
|
292
|
+
* **An absent cycle is `null`, not an error.** Most builds — an
|
|
293
|
+
* adder, a door — never repeat their own state, and that is the
|
|
294
|
+
* ordinary outcome, not a failed search.
|
|
295
|
+
*
|
|
296
|
+
* **O(ticks × blocks): replays the whole recorded span to build one
|
|
297
|
+
* digest per tick boundary**, then rebuilds full frames for the
|
|
298
|
+
* handful of candidates that survive. This is an on-demand "find
|
|
299
|
+
* cycles" action for a host UI button, never something to call per
|
|
300
|
+
* tick or per frame — poll {@link Self::timeline_activity_json} instead.
|
|
301
|
+
*
|
|
302
|
+
* Materialises the whole recorded timeline once to answer this call
|
|
303
|
+
* (an owned `RunTimeline`'s `initial` frame copies every non-air
|
|
304
|
+
* block) — acceptable for one on-demand press, not for a loop.
|
|
305
|
+
*
|
|
306
|
+
* `{"exact":null,"translated":null}` when nothing has been recorded.
|
|
307
|
+
*/
|
|
308
|
+
timelineCyclesJson(): string;
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Project `[start_tick, end_tick)` of the timeline a read query would
|
|
312
|
+
* resolve to (see {@link Self::timeline}) into the animated-GLB mesher's
|
|
313
|
+
* `Timeline` JSON — `{"origin":[x,y,z],"tick_ms":F,
|
|
314
|
+
* "events":[{"kind":"set_block"|"piston",...}]}` — via
|
|
315
|
+
* `crate::tick_timeline::mesher_timeline_json`.
|
|
316
|
+
*
|
|
317
|
+
* **Materialises the whole recorded timeline to answer this call**
|
|
318
|
+
* (an owned `RunTimeline`'s `initial` frame copies every non-air
|
|
319
|
+
* block in the world) — this is an on-demand "export this
|
|
320
|
+
* selection" action, not something to call per frame or poll.
|
|
321
|
+
*
|
|
322
|
+
* Fails if no timeline has been recorded, or if `start_tick..
|
|
323
|
+
* end_tick` is empty or outside the recorded span.
|
|
324
|
+
*/
|
|
325
|
+
animationTimelineJson(startTick: number, endTick: number, tickMs: number): string;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* The selection's starting scene — `[start_tick, end_tick)` of the
|
|
329
|
+
* timeline a read query would resolve to (see {@link Self::timeline}) —
|
|
330
|
+
* as schematic bytes, base64-encoded.
|
|
331
|
+
*
|
|
332
|
+
* A WASM handle cannot cross a worker boundary, so this exists for a
|
|
333
|
+
* host to hand the bytes to a worker, which rebuilds the schematic
|
|
334
|
+
* with `Schematic.fromData`.
|
|
335
|
+
*
|
|
336
|
+
* **Materialises the whole recorded timeline to answer this call**
|
|
337
|
+
* — see {@link Self::animation_timeline_json}; an on-demand export
|
|
338
|
+
* action, not a per-frame poll.
|
|
339
|
+
*
|
|
340
|
+
* Fails if no timeline has been recorded, or if `start_tick..
|
|
341
|
+
* end_tick` is empty or outside the recorded span.
|
|
342
|
+
*/
|
|
343
|
+
selectionSchematicB64(startTick: number, endTick: number): string;
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* How many updates have been recorded — page before pulling them.
|
|
347
|
+
*/
|
|
348
|
+
updatesCount(): number;
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Every recorded update, in delivery order.
|
|
352
|
+
*
|
|
353
|
+
* `seq` counts from 0 within each tick: that is the sub-tick axis, and
|
|
354
|
+
* `(tick, seq)` is the order the engine actually delivered them in.
|
|
355
|
+
* `state` is the block as it stood **at dispatch time**, which is what
|
|
356
|
+
* makes intra-tick order legible — a snapshot cannot show it.
|
|
357
|
+
*/
|
|
358
|
+
updatesJson(): string;
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* The recorded updates for ticks in `[from_tick, to_tick)`.
|
|
362
|
+
*
|
|
363
|
+
* The whole log for a 6x6 door's cycle is megabytes; a scrubber only
|
|
364
|
+
* ever shows one tick, so it should ask for one tick.
|
|
365
|
+
*/
|
|
366
|
+
updatesJsonBetween(fromTick: number, toTick: number): string;
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Per-tick, per-cell update counts for ticks in `[from_tick, to_tick)`.
|
|
370
|
+
*
|
|
371
|
+
* The resolution playback should run at: `{phases, ticks:[{tick, total,
|
|
372
|
+
* cells:[{p:[x,y,z], n, nb, sh, ph:[…]}]}]}`, where `nb`/`sh` split
|
|
373
|
+
* neighbour from shape and `ph` indexes the `phases` legend. Collapses
|
|
374
|
+
* a tick's tens of thousands of updates into a few hundred cells.
|
|
375
|
+
*/
|
|
376
|
+
updatesHeatJson(fromTick: number, toTick: number): string;
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* One tick's updates in delivery order, as parallel arrays.
|
|
380
|
+
*
|
|
381
|
+
* For stepping *within* a tick: `seq` is the array index, `pos` is flat
|
|
382
|
+
* x,y,z triples, `kind`/`phase`/`from` are integer codes with legends
|
|
383
|
+
* in the payload, and `state` indexes a deduplicated `states` table.
|
|
384
|
+
*/
|
|
385
|
+
updatesWaveJson(tick: number): string;
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Every block a piston currently has in flight, as JSON:
|
|
389
|
+
* `[{"to":[x,y,z],"from":[x,y,z],"state":"...","carried":"...",
|
|
390
|
+
* "carried_short":"..."|null,"remains":"..."|null,"dir":"east",
|
|
391
|
+
* "extending":bool,"started":T,"lands":T,"source_piston":bool}]`.
|
|
392
|
+
*
|
|
393
|
+
* Draw `carried` travelling `from` -> `to`, and `remains` (when it is
|
|
394
|
+
* not null) parked at `to` for the whole move. They differ from
|
|
395
|
+
* `state` — what actually lands — only for a retracting piston, whose
|
|
396
|
+
* body stays put while its head comes home; vanilla's
|
|
397
|
+
* `PistonHeadRenderer` splits exactly these two slots.
|
|
398
|
+
*
|
|
399
|
+
* `carried_short` is the same arm with `short=true`. Draw it while the
|
|
400
|
+
* head is **within half a block of its body** — `progress <= 0.5`
|
|
401
|
+
* extending, `progress >= 0.5` retracting — or the shaft passes
|
|
402
|
+
* visibly through the back of the piston as it comes home. Which form
|
|
403
|
+
* to use is yours; naming the state is the engine's.
|
|
404
|
+
*
|
|
405
|
+
* What a renderer needs to animate a stroke, from the simulator that
|
|
406
|
+
* dispatched it. The block-change stream cannot answer this: it says a
|
|
407
|
+
* cell became a `moving_piston` placeholder, not which block set off,
|
|
408
|
+
* which cell it left, or which tick it arrives — so a host that
|
|
409
|
+
* reconstructs strokes from changes is reimplementing piston mechanics
|
|
410
|
+
* downstream of the engine, and animating on a clock the simulation
|
|
411
|
+
* does not share. That desync is what draws a block twice, leaves a
|
|
412
|
+
* gap where one should be, and shears a piston head off its load.
|
|
413
|
+
*
|
|
414
|
+
* `started` and `lands` are tick numbers in the engine's frame, where
|
|
415
|
+
* {@link Self::tick_count} counts *completed* ticks: after stepping to
|
|
416
|
+
* `tick_count == t`, a flight's progress is
|
|
417
|
+
* `(t - started) / (lands - started)`, clamped to 1. Draw it while it
|
|
418
|
+
* is listed and drop it when it stops being listed — the same call
|
|
419
|
+
* that stops reporting it is the tick the real block is written, so
|
|
420
|
+
* there is no frame with both and none with neither.
|
|
421
|
+
*/
|
|
422
|
+
movingBlocksJson(): string;
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Drop the recorded block changes without stopping recording.
|
|
426
|
+
*
|
|
427
|
+
* The log grows for as long as the simulation runs and nothing
|
|
428
|
+
* empties it, so a long-running host — a browser session driving
|
|
429
|
+
* thousands of ticks — accumulates every block change forever. A
|
|
430
|
+
* host that has already consumed {@link TickSimulation::changes_json}
|
|
431
|
+
* can say so here and keep recording on. A host holding a cursor
|
|
432
|
+
* into the change log must reset that cursor when it calls this, or
|
|
433
|
+
* it will read past the end of a log that is no longer the one it
|
|
434
|
+
* was walking — the same hazard {@link TickSimulation::record_timeline}
|
|
435
|
+
* names for its own reset of this log.
|
|
436
|
+
*
|
|
437
|
+
* Refuses — and leaves the log untouched — while
|
|
438
|
+
* {@link TickSimulation::record_timeline} is recording: a run timeline
|
|
439
|
+
* is a seed frame plus this same log, and every timeline reader
|
|
440
|
+
* trusts that the log describes every mutation since recording
|
|
441
|
+
* began. Clearing it out from under a live recording would make
|
|
442
|
+
* replay silently wrong rather than fail loudly. Returns `true` if
|
|
443
|
+
* the log was cleared, `false` if the call was refused — following
|
|
444
|
+
* {@link TickSimulation::run_until_quiescent}'s convention of reporting
|
|
445
|
+
* whether the call achieved what it was asked, rather than swallowing
|
|
446
|
+
* a no-op.
|
|
447
|
+
*/
|
|
448
|
+
clearChanges(): boolean;
|
|
449
|
+
|
|
450
|
+
changesJson(): string;
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* The same JSON array {@link TickSimulation::changes_json} produces,
|
|
454
|
+
* but only the entries from index `start` onward.
|
|
455
|
+
*
|
|
456
|
+
* Exists for a host draining the log every frame while a run
|
|
457
|
+
* timeline recording refuses {@link TickSimulation::clear_changes}: the
|
|
458
|
+
* log only ever grows in that state, so without this,
|
|
459
|
+
* `changes_json` re-serialises the whole backlog on every single
|
|
460
|
+
* drain — a cost that climbs for as long as the recording runs,
|
|
461
|
+
* which is exactly when a session runs longest. Reading from a
|
|
462
|
+
* cursor keeps a drain's cost to what is actually new.
|
|
463
|
+
*
|
|
464
|
+
* `start` at or past the end of the log yields `[]`, not an error —
|
|
465
|
+
* a host racing a draining cursor against a growing log should not
|
|
466
|
+
* have to special-case "nothing new yet".
|
|
467
|
+
*/
|
|
468
|
+
changesJsonFrom(start: number): string;
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* Live item entities and minecarts, as JSON:
|
|
472
|
+
* `{"items":[{"id":N,"item":"...","count":N,"pos":[..],"vel":[..],
|
|
473
|
+
* "on_ground":bool,"contents":[{"id":"...","count":N}]}],
|
|
474
|
+
* "minecarts":[{"id":N,"kind":"...","pos":[..],"vel":[..]}]}`.
|
|
475
|
+
*/
|
|
476
|
+
itemEntitiesJson(): string;
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* Which `Entity.load` Motion semantics this run uses:
|
|
480
|
+
* `"clamp_abs_ten"` (DataVersion <= 4556 — NaN survives a cold load)
|
|
481
|
+
* or `"drop_non_finite"` (>= 4671 — it does not).
|
|
482
|
+
*
|
|
483
|
+
* Exposed because a door built on nan carts is a *different machine*
|
|
484
|
+
* under the two, and a caller that cannot tell them apart cannot
|
|
485
|
+
* report why it came apart.
|
|
486
|
+
*/
|
|
487
|
+
motionSemantics(): string;
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* How many times an entity stood in a **retracting** piston's sweep
|
|
491
|
+
* that the engine could not reproduce.
|
|
492
|
+
*
|
|
493
|
+
* A tripwire from when retraction was unmodelled — extension
|
|
494
|
+
* displacement was measured and implemented while
|
|
495
|
+
* `tools/gametest/captures/piston_pull.entities.log`'s sub-0.03
|
|
496
|
+
* movements, not uniformly backwards, had no model here. All three
|
|
497
|
+
* retraction geometries are implemented now, so this reports **0**,
|
|
498
|
+
* including on the record 3x3 door, which used to name six. It is kept
|
|
499
|
+
* because the next geometry that turns out not to be covered should be
|
|
500
|
+
* reported rather than guessed at: non-zero means this run leaned on
|
|
501
|
+
* behaviour we do not reproduce and its result is not trustworthy.
|
|
502
|
+
*/
|
|
503
|
+
pistonRetractContacts(): number;
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* Per-tick aggregates over the recorded changes, as JSON:
|
|
507
|
+
* `[{"tick":N,"changes":N,"piston":N,"redstone":N}]` — `piston`
|
|
508
|
+
* counts changes touching piston blocks (base, head, moving), and
|
|
509
|
+
* `redstone` changes touching wire/torch/repeater/comparator/
|
|
510
|
+
* observer/lamp/lever/button/pressure-plate states.
|
|
511
|
+
*/
|
|
512
|
+
eventsSummaryJson(): string;
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Every non-air block, as JSON:
|
|
516
|
+
* `[{"pos":[x,y,z],"state":"..."}]`.
|
|
517
|
+
* How many non-air blocks stand in the world right now.
|
|
518
|
+
*/
|
|
519
|
+
nonAirCount(): number;
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Center of mass (x) of every non-air block — the GA's displacement
|
|
523
|
+
* metric without a JSON round-trip. NaN when the world is empty.
|
|
524
|
+
*/
|
|
525
|
+
nonAirCenterX(): number;
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Smallest x holding a non-air block; `i32::MAX` when empty.
|
|
529
|
+
*/
|
|
530
|
+
nonAirMinX(): number;
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* Largest x holding a non-air block; `i32::MIN` when empty.
|
|
534
|
+
*/
|
|
535
|
+
nonAirMaxX(): number;
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* How many block changes recording has captured so far.
|
|
539
|
+
*/
|
|
540
|
+
changesCount(): number;
|
|
541
|
+
|
|
542
|
+
worldSnapshotJson(): string;
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Static structural analysis of the build standing in this world.
|
|
546
|
+
*
|
|
547
|
+
* One call, one JSON document: adhesion groups, piston/observer/source
|
|
548
|
+
* nodes, the four edge kinds, every minimal self-translating subgraph
|
|
549
|
+
* (the engine), payload, kickers, dead weight, and any proof that the
|
|
550
|
+
* machine cannot move.
|
|
551
|
+
*
|
|
552
|
+
* The analysis lives in the engine rather than in the caller on
|
|
553
|
+
* purpose. Every "what would this piston move?" answer comes from
|
|
554
|
+
* `resolve_push`/`resolve_pull` — the same oracle-verified resolver the
|
|
555
|
+
* tick loop runs — and a second copy of Minecraft's push rules written
|
|
556
|
+
* on the far side of this boundary would drift from it silently.
|
|
557
|
+
*/
|
|
558
|
+
machineGraphJson(): string;
|
|
559
|
+
|
|
560
|
+
/**
|
|
561
|
+
* GA pre-filter: static verdicts for a whole batch of genomes.
|
|
562
|
+
*
|
|
563
|
+
* Same flat-cell layout as {@link Self::eval_flight_batch}, and meant to run
|
|
564
|
+
* immediately before it: whatever this rejects never needs simulating.
|
|
565
|
+
* Writes one row per genome, `[rejected, rejected_for_sustained,
|
|
566
|
+
* engine_cell_count, payload_cell_count, dead_cell_count, "codes"]`.
|
|
567
|
+
*
|
|
568
|
+
* The registry, behaviour table and movability rules are built once for
|
|
569
|
+
* the batch — building them per genome costs more than the analysis.
|
|
570
|
+
*/
|
|
571
|
+
static machineGraphBatchJson(bx: number, by: number, bz: number, travel: number, xOff: number, palette: string, cells: Array<number>, airIndex: number): string;
|
|
572
|
+
}
|