nucleation 0.2.18 → 0.3.0

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.
Files changed (125) hide show
  1. package/Autostack.d.ts +43 -0
  2. package/Autostack.mjs +134 -0
  3. package/BlockPos.d.ts +28 -0
  4. package/BlockPos.mjs +129 -0
  5. package/BlockState.d.ts +39 -0
  6. package/BlockState.mjs +134 -0
  7. package/Brush.d.ts +59 -0
  8. package/Brush.mjs +203 -0
  9. package/BuildingTool.d.ts +29 -0
  10. package/BuildingTool.mjs +74 -0
  11. package/ChunkMeshResult.d.ts +75 -0
  12. package/ChunkMeshResult.mjs +253 -0
  13. package/CircuitBuilder.d.ts +118 -0
  14. package/CircuitBuilder.mjs +516 -0
  15. package/DefinitionRegion.d.ts +274 -0
  16. package/DefinitionRegion.mjs +973 -0
  17. package/Diff.d.ts +88 -0
  18. package/Diff.mjs +316 -0
  19. package/Dimensions.d.ts +28 -0
  20. package/Dimensions.mjs +129 -0
  21. package/ExecutionMode.d.ts +42 -0
  22. package/ExecutionMode.mjs +127 -0
  23. package/Fingerprint.d.ts +44 -0
  24. package/Fingerprint.mjs +197 -0
  25. package/InterpolationSpace.d.ts +25 -0
  26. package/InterpolationSpace.mjs +73 -0
  27. package/IoLayout.d.ts +26 -0
  28. package/IoLayout.mjs +81 -0
  29. package/IoLayoutBuilder.d.ts +73 -0
  30. package/IoLayoutBuilder.mjs +315 -0
  31. package/IoType.d.ts +41 -0
  32. package/IoType.mjs +125 -0
  33. package/ItemModelConfig.d.ts +65 -0
  34. package/ItemModelConfig.mjs +223 -0
  35. package/ItemModelPackBuilder.d.ts +32 -0
  36. package/ItemModelPackBuilder.mjs +104 -0
  37. package/ItemModelResult.d.ts +72 -0
  38. package/ItemModelResult.mjs +268 -0
  39. package/ItemScale.d.ts +31 -0
  40. package/ItemScale.mjs +132 -0
  41. package/LayoutFunction.d.ts +52 -0
  42. package/LayoutFunction.mjs +159 -0
  43. package/MchprsWorld.d.ts +131 -0
  44. package/MchprsWorld.mjs +423 -0
  45. package/MeshBounds.d.ts +40 -0
  46. package/MeshBounds.mjs +180 -0
  47. package/MeshConfig.d.ts +101 -0
  48. package/MeshConfig.mjs +306 -0
  49. package/MeshJob.d.ts +44 -0
  50. package/MeshJob.mjs +116 -0
  51. package/MeshPhase.d.ts +38 -0
  52. package/MeshPhase.mjs +90 -0
  53. package/MeshProgress.d.ts +32 -0
  54. package/MeshProgress.mjs +133 -0
  55. package/MeshResult.d.ts +60 -0
  56. package/MeshResult.mjs +206 -0
  57. package/MultiMeshResult.d.ts +50 -0
  58. package/MultiMeshResult.mjs +166 -0
  59. package/Nbt.d.ts +50 -0
  60. package/Nbt.mjs +161 -0
  61. package/NucleationError.d.ts +36 -0
  62. package/NucleationError.mjs +104 -0
  63. package/OutputCondition.d.ts +45 -0
  64. package/OutputCondition.mjs +129 -0
  65. package/README.md +28 -197
  66. package/RawMeshExport.d.ts +74 -0
  67. package/RawMeshExport.mjs +243 -0
  68. package/RedstoneGraph.d.ts +58 -0
  69. package/RedstoneGraph.mjs +242 -0
  70. package/RegionBounds.d.ts +41 -0
  71. package/RegionBounds.mjs +181 -0
  72. package/RenderConfig.d.ts +66 -0
  73. package/RenderConfig.mjs +170 -0
  74. package/Renderer.d.ts +35 -0
  75. package/Renderer.mjs +139 -0
  76. package/ResourcePack.d.ts +105 -0
  77. package/ResourcePack.mjs +447 -0
  78. package/ResourcePackList.d.ts +32 -0
  79. package/ResourcePackList.mjs +96 -0
  80. package/Schematic.d.ts +655 -0
  81. package/Schematic.mjs +2647 -0
  82. package/SchematicBuilder.d.ts +103 -0
  83. package/SchematicBuilder.mjs +401 -0
  84. package/SchematicRegions.d.ts +93 -0
  85. package/SchematicRegions.mjs +411 -0
  86. package/Scripting.d.ts +40 -0
  87. package/Scripting.mjs +138 -0
  88. package/Sdf.d.ts +31 -0
  89. package/Sdf.mjs +107 -0
  90. package/Shape.d.ts +108 -0
  91. package/Shape.mjs +336 -0
  92. package/SortStrategy.d.ts +86 -0
  93. package/SortStrategy.mjs +272 -0
  94. package/Store.d.ts +83 -0
  95. package/Store.mjs +369 -0
  96. package/StoreIo.d.ts +71 -0
  97. package/StoreIo.mjs +292 -0
  98. package/TextureAtlas.d.ts +40 -0
  99. package/TextureAtlas.mjs +122 -0
  100. package/TextureInfo.d.ts +34 -0
  101. package/TextureInfo.mjs +148 -0
  102. package/TypedCircuitExecutor.d.ts +101 -0
  103. package/TypedCircuitExecutor.mjs +378 -0
  104. package/Value.d.ts +73 -0
  105. package/Value.mjs +275 -0
  106. package/WorldChunkView.d.ts +63 -0
  107. package/WorldChunkView.mjs +201 -0
  108. package/WorldSink.d.ts +50 -0
  109. package/WorldSink.mjs +177 -0
  110. package/WorldStream.d.ts +45 -0
  111. package/WorldStream.mjs +184 -0
  112. package/diplomat-runtime.d.ts +15 -0
  113. package/diplomat-runtime.mjs +774 -0
  114. package/diplomat-wasm.mjs +52 -0
  115. package/diplomat.config.mjs +6 -0
  116. package/index.d.ts +113 -0
  117. package/index.mjs +116 -0
  118. package/{nucleation_bg.wasm → nucleation.wasm} +0 -0
  119. package/package.json +19 -41
  120. package/LICENSE +0 -21
  121. package/api.js +0 -608
  122. package/nucleation-cdn-loader.js +0 -15
  123. package/nucleation-original.js +0 -8383
  124. package/nucleation.d.ts +0 -2947
  125. package/nucleation.js +0 -36
package/Schematic.d.ts ADDED
@@ -0,0 +1,655 @@
1
+ // generated by diplomat-tool
2
+ import type { BlockPos } from "./BlockPos"
3
+ import type { BlockState } from "./BlockState"
4
+ import type { Dimensions } from "./Dimensions"
5
+ import type { NucleationError } from "./NucleationError"
6
+ import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
7
+
8
+
9
+
10
+ export class Schematic {
11
+ /** @internal */
12
+ get ffiValue(): pointer;
13
+ /** @internal */
14
+ constructor();
15
+
16
+
17
+ /**
18
+ * Create a new, empty schematic with the given name.
19
+ */
20
+ static create(name: string): Schematic;
21
+
22
+ /**
23
+ * The allocated dimensions (width, height, length) of the schematic's
24
+ * bounding box.
25
+ */
26
+ dimensions(): Dimensions;
27
+
28
+ /**
29
+ * Returns `true` if a block was placed (out-of-range coordinates extend the
30
+ * schematic rather than erroring, matching `UniversalSchematic::set_block`).
31
+ */
32
+ setBlock(x: number, y: number, z: number, blockName: string): boolean;
33
+
34
+ /**
35
+ * The name of the block at a position. `NotFound` if the position is
36
+ * outside every region.
37
+ */
38
+ getBlockName(x: number, y: number, z: number): string;
39
+
40
+ /**
41
+ * Save the schematic to a file, always in Litematic format (the
42
+ * extension is not consulted; use `save_to_file_with_format` for
43
+ * other formats).
44
+ */
45
+ saveToFile(path: string): void;
46
+
47
+ /**
48
+ * Load a schematic from a Litematic file (this path is
49
+ * Litematic-only; use `from_data` for format auto-detection).
50
+ */
51
+ static loadFromFile(path: string): Schematic;
52
+
53
+ /**
54
+ * Build a schematic from raw byte data, auto-detecting the format.
55
+ * Supports Litematic, Sponge Schematic, and McStructure (Bedrock) formats.
56
+ * `Parse` if a format was detected but failed to parse, `InvalidArgument` if
57
+ * no format was recognized.
58
+ */
59
+ static fromData(data: Array<number>): Schematic;
60
+
61
+ /**
62
+ * Build a schematic from Litematic data.
63
+ */
64
+ static fromLitematic(data: Array<number>): Schematic;
65
+
66
+ /**
67
+ * The schematic as Litematic bytes, base64-encoded.
68
+ */
69
+ toLitematicB64(): string;
70
+
71
+ /**
72
+ * Build a schematic from classic `.schematic` data.
73
+ */
74
+ static fromSchematic(data: Array<number>): Schematic;
75
+
76
+ /**
77
+ * The schematic as classic `.schematic` bytes, base64-encoded.
78
+ */
79
+ toSchematicB64(): string;
80
+
81
+ /**
82
+ * Build a schematic from snapshot (fast binary) data.
83
+ */
84
+ static fromSnapshot(data: Array<number>): Schematic;
85
+
86
+ /**
87
+ * The schematic as snapshot (fast binary) bytes, base64-encoded.
88
+ */
89
+ toSnapshotB64(): string;
90
+
91
+ /**
92
+ * Build a schematic from McStructure (Bedrock) data.
93
+ */
94
+ static fromMcstructure(data: Array<number>): Schematic;
95
+
96
+ /**
97
+ * The schematic as McStructure (Bedrock) bytes, base64-encoded.
98
+ */
99
+ toMcstructureB64(): string;
100
+
101
+ /**
102
+ * Import from a single MCA region file.
103
+ */
104
+ static fromMca(data: Array<number>): Schematic;
105
+
106
+ /**
107
+ * Import from MCA with coordinate bounds.
108
+ */
109
+ static fromMcaBounded(data: Array<number>, minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number): Schematic;
110
+
111
+ /**
112
+ * Import from a zipped world folder.
113
+ */
114
+ static fromWorldZip(data: Array<number>): Schematic;
115
+
116
+ /**
117
+ * Import from zipped world with coordinate bounds.
118
+ */
119
+ static fromWorldZipBounded(data: Array<number>, minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number): Schematic;
120
+
121
+ /**
122
+ * Import from a Minecraft world directory path.
123
+ */
124
+ static fromWorldDirectory(path: string): Schematic;
125
+
126
+ /**
127
+ * Import from world directory with coordinate bounds.
128
+ */
129
+ static fromWorldDirectoryBounded(path: string, minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number): Schematic;
130
+
131
+ /**
132
+ * Export the schematic as a Minecraft world: a JSON array of
133
+ * `{"path": <relative file path>, "data_b64": <base64 bytes>}` entries
134
+ * (the old `CFileMap`). `options_json` may be empty for defaults.
135
+ */
136
+ toWorldJson(optionsJson: string): string;
137
+
138
+ /**
139
+ * Export and write world files to a directory. `options_json` may be empty.
140
+ */
141
+ saveWorld(directory: string, optionsJson: string): void;
142
+
143
+ /**
144
+ * Export the schematic as a zipped Minecraft world, base64-encoded.
145
+ * `options_json` may be empty for defaults.
146
+ */
147
+ toWorldZipB64(optionsJson: string): string;
148
+
149
+ /**
150
+ * Set a block with properties given as a JSON object of string→string
151
+ * (the old `CProperty` array).
152
+ */
153
+ setBlockWithProperties(x: number, y: number, z: number, blockName: string, propertiesJson: string): void;
154
+
155
+ /**
156
+ * Set a block from a full block string, e.g.
157
+ * `minecraft:chest[facing=north]{Items:[...]}`.
158
+ */
159
+ setBlockFromString(x: number, y: number, z: number, blockString: string): void;
160
+
161
+ /**
162
+ * Pre-resolve a plain block name to a palette index for use with `place`.
163
+ * Pair them in hot loops with many unique block names to skip the per-call
164
+ * name → palette lookup.
165
+ */
166
+ prepareBlock(blockName: string): number;
167
+
168
+ /**
169
+ * Place a block by pre-resolved palette index (from `prepare_block`).
170
+ */
171
+ place(x: number, y: number, z: number, paletteIndex: number): void;
172
+
173
+ /**
174
+ * Batch-set blocks at multiple positions to the same block (name, block
175
+ * string with properties, or block string with NBT). `positions` is flat
176
+ * `[x0,y0,z0, x1,y1,z1, ...]` (length must be a multiple of 3).
177
+ * Returns the number of blocks set.
178
+ */
179
+ setBlocks(positions: Array<number>, blockName: string): number;
180
+
181
+ /**
182
+ * Batch-get block names at multiple positions. `positions` is flat
183
+ * `[x0,y0,z0, ...]` (length must be a multiple of 3). Writes a JSON array,
184
+ * one entry per position: the block name string, or `null` for
185
+ * empty/out-of-bounds positions.
186
+ */
187
+ getBlocksJson(positions: Array<number>): string;
188
+
189
+ /**
190
+ * Copy a region from `source` into this schematic. `excluded_blocks_json`
191
+ * is a JSON array of block strings to skip (empty string or `[]` for none).
192
+ */
193
+ copyRegion(source: Schematic, minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number, targetX: number, targetY: number, targetZ: number, excludedBlocksJson: string): void;
194
+
195
+ /**
196
+ * The block at a position with its properties, as a `BlockState`.
197
+ */
198
+ getBlockWithProperties(x: number, y: number, z: number): BlockState;
199
+
200
+ /**
201
+ * The full block string (name, properties, NBT) at a position.
202
+ */
203
+ getBlockString(x: number, y: number, z: number): string;
204
+
205
+ /**
206
+ * The block entity at a position as JSON
207
+ * `{"id": ..., "position": [x,y,z], "nbt": {...}}` (the old `CBlockEntity`).
208
+ */
209
+ getBlockEntityJson(x: number, y: number, z: number): string;
210
+
211
+ /**
212
+ * Every block entity as a JSON array of
213
+ * `{"id": ..., "position": [x,y,z], "nbt": {...}}`.
214
+ */
215
+ getAllBlockEntitiesJson(): string;
216
+
217
+ /**
218
+ * The number of mobile entities (not block entities).
219
+ */
220
+ entityCount(): number;
221
+
222
+ /**
223
+ * Every mobile entity as a JSON array of
224
+ * `{"id": ..., "position": [x,y,z], "nbt": {...}}` (the old `CEntityArray`).
225
+ */
226
+ getEntitiesJson(): string;
227
+
228
+ /**
229
+ * Add a mobile entity. `nbt_json` is a JSON object (may be empty).
230
+ */
231
+ addEntity(id: string, x: number, y: number, z: number, nbtJson: string): void;
232
+
233
+ /**
234
+ * Remove a mobile entity by index.
235
+ */
236
+ removeEntity(index: number): void;
237
+
238
+ /**
239
+ * The canonical in-memory data version (the forward-conversion target).
240
+ */
241
+ static canonicalDataVersion(): number;
242
+
243
+ /**
244
+ * Convert block/item/entity data between Minecraft data versions. Forward
245
+ * (`target >= source`) is lossless; reverse is lossy. Writes a JSON loss
246
+ * report (`[]` when lossless).
247
+ */
248
+ convertToDataVersion(targetDataVersion: number, sourceDataVersion: number): string;
249
+
250
+ /**
251
+ * Convert to `target_data_version` using the schematic's captured source
252
+ * version (else `mc_version`, else canonical) as origin, updating metadata
253
+ * to the target. Writes a JSON loss report (`[]` when lossless).
254
+ */
255
+ convertToVersion(targetDataVersion: number): string;
256
+
257
+ /**
258
+ * The Minecraft data version of the file this schematic was loaded from, or
259
+ * `-1` if none was captured (versionless / freshly built).
260
+ */
261
+ sourceDataVersion(): number;
262
+
263
+ /**
264
+ * Override the source data version for formats that carry no Java data
265
+ * version, so the converter knows what to convert *from*.
266
+ */
267
+ setSourceDataVersion(version: number): void;
268
+
269
+ /**
270
+ * Serialize a `.litematic` targeting a specific Minecraft data version. A
271
+ * COPY is converted and the matching Version header written; the schematic
272
+ * is left unchanged. Writes JSON
273
+ * `{"data_b64": <base64 .litematic>, "loss": <loss report>}`.
274
+ */
275
+ toLitematicForVersionJson(targetDataVersion: number): string;
276
+
277
+ /**
278
+ * The block entity's NBT as a typed SNBT string. Round-trips losslessly.
279
+ */
280
+ getBlockEntitySnbt(x: number, y: number, z: number): string;
281
+
282
+ /**
283
+ * Set (or replace) a block entity at a position from a typed SNBT string.
284
+ */
285
+ setBlockEntity(x: number, y: number, z: number, id: string, snbt: string): void;
286
+
287
+ /**
288
+ * Remove the block entity at a position. `NotFound` if none was there.
289
+ */
290
+ removeBlockEntity(x: number, y: number, z: number): void;
291
+
292
+ /**
293
+ * Every block entity as a JSON array of `{id, position: [x,y,z], snbt}`.
294
+ * The `snbt` is the inner data only (no `Id`/`Pos`).
295
+ */
296
+ getAllBlockEntitiesSnbtJson(): string;
297
+
298
+ /**
299
+ * Every mobile entity as a JSON array of typed SNBT strings (full compound
300
+ * incl. `id`/`Pos`).
301
+ */
302
+ getEntitiesSnbtJson(): string;
303
+
304
+ /**
305
+ * Add a mobile entity from a full SNBT entity compound (must contain `id`
306
+ * and `Pos`).
307
+ */
308
+ addEntityFromSnbt(snbt: string): void;
309
+
310
+ /**
311
+ * Every non-air block as a JSON array of
312
+ * `{"x", "y", "z", "name", "properties"}` (the old `CBlockArray`).
313
+ */
314
+ getAllBlocksJson(): string;
315
+
316
+ /**
317
+ * All blocks within a sub-region (chunk) of the schematic, as the same
318
+ * JSON array shape as `get_all_blocks_json`.
319
+ */
320
+ getChunkBlocksJson(offsetX: number, offsetY: number, offsetZ: number, width: number, height: number, length: number): string;
321
+
322
+ /**
323
+ * Split the schematic into chunks (default bottom-up strategy). Writes a
324
+ * JSON array of `{"chunk_x", "chunk_y", "chunk_z", "blocks": [...]}` where
325
+ * blocks have the `get_all_blocks_json` shape (the old `CChunkArray`).
326
+ */
327
+ getChunksJson(chunkWidth: number, chunkHeight: number, chunkLength: number): string;
328
+
329
+ /**
330
+ * Split the schematic into chunks with a loading strategy: one of
331
+ * `distance_to_camera`, `top_down`, `bottom_up`, `center_outward`,
332
+ * `random` (anything else falls back to `bottom_up`). Camera coordinates
333
+ * are only used by `distance_to_camera`. Same JSON shape as
334
+ * `get_chunks_json`.
335
+ */
336
+ getChunksWithStrategyJson(chunkWidth: number, chunkHeight: number, chunkLength: number, strategy: string, cameraX: number, cameraY: number, cameraZ: number): string;
337
+
338
+ /**
339
+ * The total number of non-air blocks in the schematic.
340
+ */
341
+ blockCount(): number;
342
+
343
+ /**
344
+ * The total volume of the schematic's bounding box.
345
+ */
346
+ volume(): number;
347
+
348
+ /**
349
+ * The names of all regions, as a JSON array of strings.
350
+ */
351
+ regionNamesJson(): string;
352
+
353
+ /**
354
+ * Basic debug info about the schematic (name + region count).
355
+ */
356
+ debugInfo(): string;
357
+
358
+ /**
359
+ * A formatted schematic layout string (old `schematic_print`).
360
+ */
361
+ printString(): string;
362
+
363
+ /**
364
+ * A formatted schematic layout string (old `schematic_print_schematic`;
365
+ * same output as `print_string`).
366
+ */
367
+ printSchematicString(): string;
368
+
369
+ /**
370
+ * A detailed debug string, including a visual layout (old `debug_schematic`).
371
+ */
372
+ debugString(): string;
373
+
374
+ /**
375
+ * A detailed debug string with a JSON layout (old `debug_json_schematic`).
376
+ */
377
+ debugJsonString(): string;
378
+
379
+ /**
380
+ * The schematic name. `NotFound` if not set.
381
+ */
382
+ name(): string;
383
+
384
+ /**
385
+ * Set the schematic name.
386
+ */
387
+ setName(name: string): void;
388
+
389
+ /**
390
+ * The schematic author. `NotFound` if not set.
391
+ */
392
+ author(): string;
393
+
394
+ /**
395
+ * Set the schematic author.
396
+ */
397
+ setAuthor(author: string): void;
398
+
399
+ /**
400
+ * The schematic description. `NotFound` if not set.
401
+ */
402
+ description(): string;
403
+
404
+ /**
405
+ * Set the schematic description.
406
+ */
407
+ setDescription(description: string): void;
408
+
409
+ /**
410
+ * The creation timestamp (milliseconds since epoch), or `-1` if not set.
411
+ */
412
+ created(): bigint;
413
+
414
+ /**
415
+ * Set the creation timestamp (milliseconds since epoch).
416
+ */
417
+ setCreated(created: bigint): void;
418
+
419
+ /**
420
+ * The modification timestamp (milliseconds since epoch), or `-1` if not set.
421
+ */
422
+ modified(): bigint;
423
+
424
+ /**
425
+ * Set the modification timestamp (milliseconds since epoch).
426
+ */
427
+ setModified(modified: bigint): void;
428
+
429
+ /**
430
+ * The Litematic format version, or `-1` if not set.
431
+ */
432
+ lmVersion(): number;
433
+
434
+ /**
435
+ * Set the Litematic format version.
436
+ */
437
+ setLmVersion(version: number): void;
438
+
439
+ /**
440
+ * The Minecraft data version, or `-1` if not set.
441
+ */
442
+ mcVersion(): number;
443
+
444
+ /**
445
+ * Set the Minecraft data version.
446
+ */
447
+ setMcVersion(version: number): void;
448
+
449
+ /**
450
+ * The WorldEdit version, or `-1` if not set.
451
+ */
452
+ weVersion(): number;
453
+
454
+ /**
455
+ * Set the WorldEdit version.
456
+ */
457
+ setWeVersion(version: number): void;
458
+
459
+ /**
460
+ * Mirror the default region along the X axis (in place). Block
461
+ * orientations (e.g. `facing` properties), block entities, and
462
+ * entities are mirrored too.
463
+ */
464
+ flipX(): void;
465
+
466
+ /**
467
+ * Mirror the default region along the Y axis (in place). Block
468
+ * orientations, block entities, and entities are mirrored too.
469
+ */
470
+ flipY(): void;
471
+
472
+ /**
473
+ * Mirror the default region along the Z axis (in place). Block
474
+ * orientations, block entities, and entities are mirrored too.
475
+ */
476
+ flipZ(): void;
477
+
478
+ /**
479
+ * Rotate the default region about the X axis. `degrees` must be a
480
+ * multiple of 90 (anything else is a no-op; negative values wrap).
481
+ * +90° maps +Z onto +Y (south face rotates up). The region keeps its
482
+ * minimum corner; block orientations and entities are updated.
483
+ */
484
+ rotateX(degrees: number): void;
485
+
486
+ /**
487
+ * Rotate the default region about the Y axis (horizontal plane).
488
+ * `degrees` must be a multiple of 90 (anything else is a no-op;
489
+ * negative values wrap). +90° maps +X onto -Z (east to north, i.e.
490
+ * counterclockwise seen from above). The region keeps its minimum
491
+ * corner; block orientations and entities are updated.
492
+ */
493
+ rotateY(degrees: number): void;
494
+
495
+ /**
496
+ * Rotate the default region about the Z axis. `degrees` must be a
497
+ * multiple of 90 (anything else is a no-op; negative values wrap).
498
+ * +90° maps +Y onto +X (up rotates east). The region keeps its
499
+ * minimum corner; block orientations and entities are updated.
500
+ */
501
+ rotateZ(degrees: number): void;
502
+
503
+ /**
504
+ * Mirror a named region along the X axis (like `flip_x`). `NotFound`
505
+ * if no region has that name.
506
+ */
507
+ flipRegionX(regionName: string): void;
508
+
509
+ /**
510
+ * Mirror a named region along the Y axis (like `flip_y`). `NotFound`
511
+ * if no region has that name.
512
+ */
513
+ flipRegionY(regionName: string): void;
514
+
515
+ /**
516
+ * Mirror a named region along the Z axis (like `flip_z`). `NotFound`
517
+ * if no region has that name.
518
+ */
519
+ flipRegionZ(regionName: string): void;
520
+
521
+ /**
522
+ * Rotate a named region about the X axis by a multiple of 90 degrees
523
+ * (same semantics as `rotate_x`). `NotFound` if no region has that
524
+ * name.
525
+ */
526
+ rotateRegionX(regionName: string, degrees: number): void;
527
+
528
+ /**
529
+ * Rotate a named region about the Y axis by a multiple of 90 degrees
530
+ * (same semantics as `rotate_y`). `NotFound` if no region has that
531
+ * name.
532
+ */
533
+ rotateRegionY(regionName: string, degrees: number): void;
534
+
535
+ /**
536
+ * Rotate a named region about the Z axis by a multiple of 90 degrees
537
+ * (same semantics as `rotate_z`). `NotFound` if no region has that
538
+ * name.
539
+ */
540
+ rotateRegionZ(regionName: string, degrees: number): void;
541
+
542
+ /**
543
+ * Fill a cuboid with a block.
544
+ */
545
+ fillCuboid(minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number, blockName: string): void;
546
+
547
+ /**
548
+ * Fill a sphere with a block.
549
+ */
550
+ fillSphere(cx: number, cy: number, cz: number, radius: number, blockName: string): void;
551
+
552
+ /**
553
+ * Serialize to a named format, base64-encoded. `version` and `settings`
554
+ * may be empty strings for defaults.
555
+ */
556
+ saveAsB64(format: string, version: string, settings: string): string;
557
+
558
+ /**
559
+ * Save to a file. If `format` is empty, the format is auto-detected from
560
+ * the file extension; `version` may be empty for the default.
561
+ */
562
+ saveToFileWithFormat(path: string, format: string, version: string): void;
563
+
564
+ /**
565
+ * Serialize as a Sponge schematic targeting a specific format version,
566
+ * base64-encoded.
567
+ */
568
+ toSchematicVersionB64(version: string): string;
569
+
570
+ /**
571
+ * The available Sponge schematic exporter versions, as a JSON array of
572
+ * strings.
573
+ */
574
+ static availableSchematicVersionsJson(): string;
575
+
576
+ /**
577
+ * Set a block with NBT data given as a JSON object of string→string
578
+ * (may be empty).
579
+ */
580
+ setBlockWithNbt(x: number, y: number, z: number, blockName: string, nbtJson: string): void;
581
+
582
+ /**
583
+ * Set a block (by name) in a named region.
584
+ */
585
+ setBlockInRegion(regionName: string, x: number, y: number, z: number, blockName: string): void;
586
+
587
+ /**
588
+ * The schematic bounding box as a JSON array
589
+ * `[min_x, min_y, min_z, max_x, max_y, max_z]`.
590
+ */
591
+ boundingBoxJson(): string;
592
+
593
+ /**
594
+ * A named region's bounding box as a JSON array
595
+ * `[min_x, min_y, min_z, max_x, max_y, max_z]`. `"default"`/`"Default"`
596
+ * address the default region.
597
+ */
598
+ regionBoundingBoxJson(regionName: string): string;
599
+
600
+ /**
601
+ * The merged-region palette block names, as a JSON array of strings.
602
+ */
603
+ paletteJson(): string;
604
+
605
+ /**
606
+ * The tight (content) dimensions.
607
+ */
608
+ tightDimensions(): Dimensions;
609
+
610
+ /**
611
+ * The allocated dimensions (same as `dimensions`; named for parity with
612
+ * the old `schematic_get_allocated_dimensions`).
613
+ */
614
+ allocatedDimensions(): Dimensions;
615
+
616
+ /**
617
+ * Every sign in the schematic, as a JSON array of
618
+ * `{"pos": [x,y,z], "text": [...]}`.
619
+ */
620
+ extractSignsJson(): string;
621
+
622
+ /**
623
+ * Compile the schematic's insign annotations to JSON.
624
+ */
625
+ compileInsignJson(): string;
626
+
627
+ /**
628
+ * Every region's palette, as a JSON object mapping region name → array of
629
+ * block names (the default region under `"default"`).
630
+ */
631
+ allPalettesJson(): string;
632
+
633
+ /**
634
+ * The default region's palette block names, as a JSON array of strings.
635
+ */
636
+ defaultRegionPaletteJson(): string;
637
+
638
+ /**
639
+ * A named region's palette block names, as a JSON array of strings.
640
+ * `"default"`/`"Default"` address the default region.
641
+ */
642
+ regionPaletteJson(regionName: string): string;
643
+
644
+ /**
645
+ * The minimum corner of the tight (content) bounds. `NotFound` when the
646
+ * schematic has no content.
647
+ */
648
+ tightBoundsMin(): BlockPos;
649
+
650
+ /**
651
+ * The maximum corner of the tight (content) bounds. `NotFound` when the
652
+ * schematic has no content.
653
+ */
654
+ tightBoundsMax(): BlockPos;
655
+ }