nucleation 0.2.13 → 0.2.16

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.
@@ -373,6 +373,10 @@ const RawMeshExportWrapperFinalization = (typeof FinalizationRegistry === 'undef
373
373
  ? { register: () => {}, unregister: () => {} }
374
374
  : new FinalizationRegistry(ptr => wasm.__wbg_rawmeshexportwrapper_free(ptr >>> 0, 1));
375
375
 
376
+ const RedstoneGraphWrapperFinalization = (typeof FinalizationRegistry === 'undefined')
377
+ ? { register: () => {}, unregister: () => {} }
378
+ : new FinalizationRegistry(ptr => wasm.__wbg_redstonegraphwrapper_free(ptr >>> 0, 1));
379
+
376
380
  const ResourcePackWrapperFinalization = (typeof FinalizationRegistry === 'undefined')
377
381
  ? { register: () => {}, unregister: () => {} }
378
382
  : new FinalizationRegistry(ptr => wasm.__wbg_resourcepackwrapper_free(ptr >>> 0, 1));
@@ -421,6 +425,18 @@ const WasmBuildingToolFinalization = (typeof FinalizationRegistry === 'undefined
421
425
  ? { register: () => {}, unregister: () => {} }
422
426
  : new FinalizationRegistry(ptr => wasm.__wbg_wasmbuildingtool_free(ptr >>> 0, 1));
423
427
 
428
+ const WorldChunkIterWrapperFinalization = (typeof FinalizationRegistry === 'undefined')
429
+ ? { register: () => {}, unregister: () => {} }
430
+ : new FinalizationRegistry(ptr => wasm.__wbg_worldchunkiterwrapper_free(ptr >>> 0, 1));
431
+
432
+ const WorldChunkViewWrapperFinalization = (typeof FinalizationRegistry === 'undefined')
433
+ ? { register: () => {}, unregister: () => {} }
434
+ : new FinalizationRegistry(ptr => wasm.__wbg_worldchunkviewwrapper_free(ptr >>> 0, 1));
435
+
436
+ const WorldSourceWrapperFinalization = (typeof FinalizationRegistry === 'undefined')
437
+ ? { register: () => {}, unregister: () => {} }
438
+ : new FinalizationRegistry(ptr => wasm.__wbg_worldsourcewrapper_free(ptr >>> 0, 1));
439
+
424
440
  export class BlockPosition {
425
441
  __destroy_into_raw() {
426
442
  const ptr = this.__wbg_ptr;
@@ -1766,7 +1782,7 @@ export class DiffWrapper {
1766
1782
  /**
1767
1783
  * Connected change regions as a JSON array.
1768
1784
  *
1769
- * Each region: `{min:[x,y,z], max:[x,y,z], kind:"added|removed|changed|mixed", count}`.
1785
+ * Each region: `{min:[x,y,z], max:[x,y,z], kind:"added|removed|changed|swapped|mixed", count}`.
1770
1786
  * @returns {string}
1771
1787
  */
1772
1788
  regionsJson() {
@@ -1877,11 +1893,14 @@ export class DiffWrapper {
1877
1893
  }
1878
1894
  /**
1879
1895
  * Total edit distance (sum of weighted add/delete/change/swap costs).
1896
+ *
1897
+ * Surfaced as a JS `number` (f64). Edit distances stay well within f64's
1898
+ * exact-integer range; the core value is `u64`.
1880
1899
  * @returns {number}
1881
1900
  */
1882
1901
  get distance() {
1883
1902
  const ret = wasm.diffwrapper_distance(this.__wbg_ptr);
1884
- return ret >>> 0;
1903
+ return ret;
1885
1904
  }
1886
1905
  /**
1887
1906
  * Reconstruct a diff from a JSON string produced by `toJson()`.
@@ -2830,6 +2849,17 @@ export class MchprsWorldWrapper {
2830
2849
  const ptr = this.__destroy_into_raw();
2831
2850
  wasm.__wbg_mchprsworldwrapper_free(ptr, 0);
2832
2851
  }
2852
+ /**
2853
+ * Extract the compiled redstone logic graph for this world.
2854
+ * @returns {RedstoneGraphWrapper}
2855
+ */
2856
+ exportGraph() {
2857
+ const ret = wasm.mchprsworldwrapper_exportGraph(this.__wbg_ptr);
2858
+ if (ret[2]) {
2859
+ throw takeFromExternrefTable0(ret[1]);
2860
+ }
2861
+ return RedstoneGraphWrapper.__wrap(ret[0]);
2862
+ }
2833
2863
  /**
2834
2864
  * Simulates a right-click on a block (typically a lever)
2835
2865
  * @param {number} x
@@ -2966,6 +2996,17 @@ export class MchprsWorldWrapper {
2966
2996
  clearCustomIoChanges() {
2967
2997
  wasm.mchprsworldwrapper_clearCustomIoChanges(this.__wbg_ptr);
2968
2998
  }
2999
+ /**
3000
+ * Extract the structural (pre-fold, as-built) redstone logic graph.
3001
+ * @returns {RedstoneGraphWrapper}
3002
+ */
3003
+ exportGraphStructural() {
3004
+ const ret = wasm.mchprsworldwrapper_exportGraphStructural(this.__wbg_ptr);
3005
+ if (ret[2]) {
3006
+ throw takeFromExternrefTable0(ret[1]);
3007
+ }
3008
+ return RedstoneGraphWrapper.__wrap(ret[0]);
3009
+ }
2969
3010
  /**
2970
3011
  * @param {SchematicWrapper} schematic
2971
3012
  */
@@ -3755,6 +3796,164 @@ export class RawMeshExportWrapper {
3755
3796
  }
3756
3797
  if (Symbol.dispose) RawMeshExportWrapper.prototype[Symbol.dispose] = RawMeshExportWrapper.prototype.free;
3757
3798
 
3799
+ /**
3800
+ * A wrapper around an extracted [`RedstoneGraph`] for JS consumers.
3801
+ */
3802
+ export class RedstoneGraphWrapper {
3803
+ static __wrap(ptr) {
3804
+ ptr = ptr >>> 0;
3805
+ const obj = Object.create(RedstoneGraphWrapper.prototype);
3806
+ obj.__wbg_ptr = ptr;
3807
+ RedstoneGraphWrapperFinalization.register(obj, obj.__wbg_ptr, obj);
3808
+ return obj;
3809
+ }
3810
+ __destroy_into_raw() {
3811
+ const ptr = this.__wbg_ptr;
3812
+ this.__wbg_ptr = 0;
3813
+ RedstoneGraphWrapperFinalization.unregister(this);
3814
+ return ptr;
3815
+ }
3816
+ free() {
3817
+ const ptr = this.__destroy_into_raw();
3818
+ wasm.__wbg_redstonegraphwrapper_free(ptr, 0);
3819
+ }
3820
+ /**
3821
+ * Total number of directed edges in the graph.
3822
+ * @returns {number}
3823
+ */
3824
+ get edgeCount() {
3825
+ const ret = wasm.redstonegraphwrapper_edgeCount(this.__wbg_ptr);
3826
+ return ret >>> 0;
3827
+ }
3828
+ /**
3829
+ * Number of nodes in the graph.
3830
+ * @returns {number}
3831
+ */
3832
+ get nodeCount() {
3833
+ const ret = wasm.redstonegraphwrapper_nodeCount(this.__wbg_ptr);
3834
+ return ret >>> 0;
3835
+ }
3836
+ /**
3837
+ * Compute the structural/functional/exact fingerprint as a hex string.
3838
+ *
3839
+ * `preset` defaults to `"structural"`; throws for an unknown preset.
3840
+ * @param {string | null} [preset]
3841
+ * @returns {string}
3842
+ */
3843
+ fingerprint(preset) {
3844
+ let deferred3_0;
3845
+ let deferred3_1;
3846
+ try {
3847
+ var ptr0 = isLikeNone(preset) ? 0 : passStringToWasm0(preset, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3848
+ var len0 = WASM_VECTOR_LEN;
3849
+ const ret = wasm.redstonegraphwrapper_fingerprint(this.__wbg_ptr, ptr0, len0);
3850
+ var ptr2 = ret[0];
3851
+ var len2 = ret[1];
3852
+ if (ret[3]) {
3853
+ ptr2 = 0; len2 = 0;
3854
+ throw takeFromExternrefTable0(ret[2]);
3855
+ }
3856
+ deferred3_0 = ptr2;
3857
+ deferred3_1 = len2;
3858
+ return getStringFromWasm0(ptr2, len2);
3859
+ } finally {
3860
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
3861
+ }
3862
+ }
3863
+ /**
3864
+ * The computed graph features serialized as a JSON string.
3865
+ * @returns {string}
3866
+ */
3867
+ featuresJson() {
3868
+ let deferred2_0;
3869
+ let deferred2_1;
3870
+ try {
3871
+ const ret = wasm.redstonegraphwrapper_featuresJson(this.__wbg_ptr);
3872
+ var ptr1 = ret[0];
3873
+ var len1 = ret[1];
3874
+ if (ret[3]) {
3875
+ ptr1 = 0; len1 = 0;
3876
+ throw takeFromExternrefTable0(ret[2]);
3877
+ }
3878
+ deferred2_0 = ptr1;
3879
+ deferred2_1 = len1;
3880
+ return getStringFromWasm0(ptr1, len1);
3881
+ } finally {
3882
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
3883
+ }
3884
+ }
3885
+ /**
3886
+ * The directed edges as an array of `{source, target, kind, strength}`.
3887
+ * @returns {any}
3888
+ */
3889
+ get edges() {
3890
+ const ret = wasm.redstonegraphwrapper_edges(this.__wbg_ptr);
3891
+ if (ret[2]) {
3892
+ throw takeFromExternrefTable0(ret[1]);
3893
+ }
3894
+ return takeFromExternrefTable0(ret[0]);
3895
+ }
3896
+ /**
3897
+ * The nodes as an array of plain objects (kind-specific fields inlined).
3898
+ * @returns {any}
3899
+ */
3900
+ get nodes() {
3901
+ const ret = wasm.redstonegraphwrapper_nodes(this.__wbg_ptr);
3902
+ if (ret[2]) {
3903
+ throw takeFromExternrefTable0(ret[1]);
3904
+ }
3905
+ return takeFromExternrefTable0(ret[0]);
3906
+ }
3907
+ /**
3908
+ * Serialize the graph to JSON.
3909
+ * @returns {string}
3910
+ */
3911
+ toJson() {
3912
+ let deferred2_0;
3913
+ let deferred2_1;
3914
+ try {
3915
+ const ret = wasm.redstonegraphwrapper_toJson(this.__wbg_ptr);
3916
+ var ptr1 = ret[0];
3917
+ var len1 = ret[1];
3918
+ if (ret[3]) {
3919
+ ptr1 = 0; len1 = 0;
3920
+ throw takeFromExternrefTable0(ret[2]);
3921
+ }
3922
+ deferred2_0 = ptr1;
3923
+ deferred2_1 = len1;
3924
+ return getStringFromWasm0(ptr1, len1);
3925
+ } finally {
3926
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
3927
+ }
3928
+ }
3929
+ /**
3930
+ * Computed graph features as a plain object.
3931
+ * @returns {any}
3932
+ */
3933
+ features() {
3934
+ const ret = wasm.redstonegraphwrapper_features(this.__wbg_ptr);
3935
+ if (ret[2]) {
3936
+ throw takeFromExternrefTable0(ret[1]);
3937
+ }
3938
+ return takeFromExternrefTable0(ret[0]);
3939
+ }
3940
+ /**
3941
+ * Deserialize a graph from JSON.
3942
+ * @param {string} s
3943
+ * @returns {RedstoneGraphWrapper}
3944
+ */
3945
+ static fromJson(s) {
3946
+ const ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3947
+ const len0 = WASM_VECTOR_LEN;
3948
+ const ret = wasm.redstonegraphwrapper_fromJson(ptr0, len0);
3949
+ if (ret[2]) {
3950
+ throw takeFromExternrefTable0(ret[1]);
3951
+ }
3952
+ return RedstoneGraphWrapper.__wrap(ret[0]);
3953
+ }
3954
+ }
3955
+ if (Symbol.dispose) RedstoneGraphWrapper.prototype[Symbol.dispose] = RedstoneGraphWrapper.prototype.free;
3956
+
3758
3957
  /**
3759
3958
  * Wrapper for a Minecraft resource pack.
3760
3959
  */
@@ -4192,6 +4391,34 @@ export class SchematicWrapper {
4192
4391
  const ptr = this.__destroy_into_raw();
4193
4392
  wasm.__wbg_schematicwrapper_free(ptr, 0);
4194
4393
  }
4394
+ /**
4395
+ * Creates a simulation world for this schematic with default options
4396
+ *
4397
+ * This allows you to simulate redstone circuits and interact with them.
4398
+ * @returns {MchprsWorldWrapper}
4399
+ */
4400
+ create_simulation_world() {
4401
+ const ret = wasm.schematicwrapper_create_simulation_world(this.__wbg_ptr);
4402
+ if (ret[2]) {
4403
+ throw takeFromExternrefTable0(ret[1]);
4404
+ }
4405
+ return MchprsWorldWrapper.__wrap(ret[0]);
4406
+ }
4407
+ /**
4408
+ * Creates a simulation world for this schematic with custom options
4409
+ *
4410
+ * This allows you to configure simulation behavior like wire state tracking.
4411
+ * @param {SimulationOptionsWrapper} options
4412
+ * @returns {MchprsWorldWrapper}
4413
+ */
4414
+ create_simulation_world_with_options(options) {
4415
+ _assertClass(options, SimulationOptionsWrapper);
4416
+ const ret = wasm.schematicwrapper_create_simulation_world_with_options(this.__wbg_ptr, options.__wbg_ptr);
4417
+ if (ret[2]) {
4418
+ throw takeFromExternrefTable0(ret[1]);
4419
+ }
4420
+ return MchprsWorldWrapper.__wrap(ret[0]);
4421
+ }
4195
4422
  /**
4196
4423
  * Compute the content fingerprint as a hex string.
4197
4424
  *
@@ -4301,6 +4528,27 @@ export class SchematicWrapper {
4301
4528
  wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
4302
4529
  }
4303
4530
  }
4531
+ /**
4532
+ * Structurally diff this schematic against `other`.
4533
+ *
4534
+ * `preset` defaults to `"exact"`. `options` is an optional object
4535
+ * `{cost_add?, cost_delete?, cost_change?, cost_swap?, swap_dominance_pct?,
4536
+ * symmetry?}`. Returns a [`DiffWrapper`]. Unknown preset/symmetry → Err.
4537
+ * @param {SchematicWrapper} other
4538
+ * @param {string | null | undefined} preset
4539
+ * @param {any} options
4540
+ * @returns {DiffWrapper}
4541
+ */
4542
+ diff(other, preset, options) {
4543
+ _assertClass(other, SchematicWrapper);
4544
+ var ptr0 = isLikeNone(preset) ? 0 : passStringToWasm0(preset, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4545
+ var len0 = WASM_VECTOR_LEN;
4546
+ const ret = wasm.schematicwrapper_diff(this.__wbg_ptr, other.__wbg_ptr, ptr0, len0, options);
4547
+ if (ret[2]) {
4548
+ throw takeFromExternrefTable0(ret[1]);
4549
+ }
4550
+ return DiffWrapper.__wrap(ret[0]);
4551
+ }
4304
4552
  /**
4305
4553
  * Add a mobile entity to the schematic.
4306
4554
  * @param {string} id
@@ -4950,6 +5198,27 @@ export class SchematicWrapper {
4950
5198
  throw takeFromExternrefTable0(ret[0]);
4951
5199
  }
4952
5200
  }
5201
+ /**
5202
+ * Same as `fromSdf` with explicit inclusive sampling bounds.
5203
+ * @param {string} sdf_json
5204
+ * @param {string} rules_json
5205
+ * @param {number} min_x
5206
+ * @param {number} min_y
5207
+ * @param {number} min_z
5208
+ * @param {number} max_x
5209
+ * @param {number} max_y
5210
+ * @param {number} max_z
5211
+ */
5212
+ fromSdfBounded(sdf_json, rules_json, min_x, min_y, min_z, max_x, max_y, max_z) {
5213
+ const ptr0 = passStringToWasm0(sdf_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5214
+ const len0 = WASM_VECTOR_LEN;
5215
+ const ptr1 = passStringToWasm0(rules_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5216
+ const len1 = WASM_VECTOR_LEN;
5217
+ const ret = wasm.schematicwrapper_fromSdfBounded(this.__wbg_ptr, ptr0, len0, ptr1, len1, min_x, min_y, min_z, max_x, max_y, max_z);
5218
+ if (ret[1]) {
5219
+ throw takeFromExternrefTable0(ret[0]);
5220
+ }
5221
+ }
4953
5222
  /**
4954
5223
  * Get all palettes once - eliminates repeated string transfers
4955
5224
  * Returns: { default: [BlockState], regions: { regionName: [BlockState] } }
@@ -4960,6 +5229,11 @@ export class SchematicWrapper {
4960
5229
  return ret;
4961
5230
  }
4962
5231
  /**
5232
+ * Get the structured block entity at a position as `{id, position, nbt}`,
5233
+ * or NULL if there is none. Returns *every* block-entity type (chests,
5234
+ * signs, furnaces, banners, spawners, …) — not just chests — so the editor
5235
+ * can read all the NBT nucleation preserves. (For a precision-faithful
5236
+ * representation of `Long`/`LongArray` fields, see `getBlockEntitySnbt`.)
4963
5237
  * @param {number} x
4964
5238
  * @param {number} y
4965
5239
  * @param {number} z
@@ -5014,6 +5288,69 @@ export class SchematicWrapper {
5014
5288
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
5015
5289
  return v1;
5016
5290
  }
5291
+ /**
5292
+ * Set (or replace) a block entity at a position from an SNBT string. This is
5293
+ * the faithful, fully-typed write path the editor uses to persist
5294
+ * container contents, sign text, banner patterns, item components, etc.
5295
+ * SNBT preserves every NBT tag type with no precision loss.
5296
+ * @param {number} x
5297
+ * @param {number} y
5298
+ * @param {number} z
5299
+ * @param {string} id
5300
+ * @param {string} snbt
5301
+ */
5302
+ setBlockEntity(x, y, z, id, snbt) {
5303
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5304
+ const len0 = WASM_VECTOR_LEN;
5305
+ const ptr1 = passStringToWasm0(snbt, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5306
+ const len1 = WASM_VECTOR_LEN;
5307
+ const ret = wasm.schematicwrapper_setBlockEntity(this.__wbg_ptr, x, y, z, ptr0, len0, ptr1, len1);
5308
+ if (ret[1]) {
5309
+ throw takeFromExternrefTable0(ret[0]);
5310
+ }
5311
+ }
5312
+ /**
5313
+ * Detect repeating structures (by region coverage). Returns an array of
5314
+ * objects: `{ mode, vectors, coverage, region_min, region_max, cell_min,
5315
+ * cell_max, label }`.
5316
+ * @returns {any}
5317
+ */
5318
+ detectStructures() {
5319
+ const ret = wasm.schematicwrapper_detectStructures(this.__wbg_ptr);
5320
+ return ret;
5321
+ }
5322
+ /**
5323
+ * Faithful, precision-safe read of every mobile entity as an SNBT string
5324
+ * (the full entity compound incl. `id`/`Pos`, typed). Mirrors
5325
+ * `getBlockEntitySnbt` so the editor can carry entity NBT verbatim.
5326
+ * @returns {Array<any>}
5327
+ */
5328
+ getEntitiesSnbt() {
5329
+ const ret = wasm.schematicwrapper_getEntitiesSnbt(this.__wbg_ptr);
5330
+ return ret;
5331
+ }
5332
+ /**
5333
+ * Convert to `target_data_version` using the schematic's *captured* source
5334
+ * version (`source_data_version`, else `mc_version`, else canonical) as the
5335
+ * origin, updating the metadata version to the target. Returns the JSON loss
5336
+ * report (empty `[]` when lossless). This is the ergonomic save/load entry:
5337
+ * `convertToVersion(CANONICAL)` on load, `convertToVersion(target)` before
5338
+ * exporting for an older version.
5339
+ * @param {number} target_data_version
5340
+ * @returns {string}
5341
+ */
5342
+ convertToVersion(target_data_version) {
5343
+ let deferred1_0;
5344
+ let deferred1_1;
5345
+ try {
5346
+ const ret = wasm.schematicwrapper_convertToVersion(this.__wbg_ptr, target_data_version);
5347
+ deferred1_0 = ret[0];
5348
+ deferred1_1 = ret[1];
5349
+ return getStringFromWasm0(ret[0], ret[1]);
5350
+ } finally {
5351
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
5352
+ }
5353
+ }
5017
5354
  /**
5018
5355
  * @param {number} x
5019
5356
  * @param {number} y
@@ -5029,6 +5366,41 @@ export class SchematicWrapper {
5029
5366
  throw takeFromExternrefTable0(ret[0]);
5030
5367
  }
5031
5368
  }
5369
+ /**
5370
+ * Resize a 1D / diagonal periodic structure along its period vector,
5371
+ * producing `units` repeating cells.
5372
+ * @param {number} vx
5373
+ * @param {number} vy
5374
+ * @param {number} vz
5375
+ * @param {number} units
5376
+ * @returns {SchematicWrapper}
5377
+ */
5378
+ autostackResize1d(vx, vy, vz, units) {
5379
+ const ret = wasm.schematicwrapper_autostackResize1d(this.__wbg_ptr, vx, vy, vz, units);
5380
+ if (ret[2]) {
5381
+ throw takeFromExternrefTable0(ret[1]);
5382
+ }
5383
+ return SchematicWrapper.__wrap(ret[0]);
5384
+ }
5385
+ /**
5386
+ * Resize a 2D periodic structure to `n1`×`n2` cells along the two vectors.
5387
+ * @param {number} v1x
5388
+ * @param {number} v1y
5389
+ * @param {number} v1z
5390
+ * @param {number} v2x
5391
+ * @param {number} v2y
5392
+ * @param {number} v2z
5393
+ * @param {number} n1
5394
+ * @param {number} n2
5395
+ * @returns {SchematicWrapper}
5396
+ */
5397
+ autostackResize2d(v1x, v1y, v1z, v2x, v2y, v2z, n1, n2) {
5398
+ const ret = wasm.schematicwrapper_autostackResize2d(this.__wbg_ptr, v1x, v1y, v1z, v2x, v2y, v2z, n1, n2);
5399
+ if (ret[2]) {
5400
+ throw takeFromExternrefTable0(ret[1]);
5401
+ }
5402
+ return SchematicWrapper.__wrap(ret[0]);
5403
+ }
5032
5404
  /**
5033
5405
  * @param {string} format
5034
5406
  * @returns {Array<any>}
@@ -5039,6 +5411,17 @@ export class SchematicWrapper {
5039
5411
  const ret = wasm.schematicwrapper_get_format_versions(ptr0, len0);
5040
5412
  return ret;
5041
5413
  }
5414
+ /**
5415
+ * Remove the block entity at a position. Returns true if one was removed.
5416
+ * @param {number} x
5417
+ * @param {number} y
5418
+ * @param {number} z
5419
+ * @returns {boolean}
5420
+ */
5421
+ removeBlockEntity(x, y, z) {
5422
+ const ret = wasm.schematicwrapper_removeBlockEntity(this.__wbg_ptr, x, y, z);
5423
+ return ret !== 0;
5424
+ }
5042
5425
  /**
5043
5426
  * @param {string} region_name
5044
5427
  * @param {number} x
@@ -5056,9 +5439,23 @@ export class SchematicWrapper {
5056
5439
  return ret !== 0;
5057
5440
  }
5058
5441
  /**
5059
- * @param {number} chunk_width
5060
- * @param {number} chunk_height
5061
- * @param {number} chunk_length
5442
+ * Add a mobile entity from a full SNBT entity compound (must contain `id`
5443
+ * and `Pos`). The faithful, fully-typed entity write path — mirrors
5444
+ * `setBlockEntity` for block entities.
5445
+ * @param {string} snbt
5446
+ */
5447
+ addEntityFromSnbt(snbt) {
5448
+ const ptr0 = passStringToWasm0(snbt, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5449
+ const len0 = WASM_VECTOR_LEN;
5450
+ const ret = wasm.schematicwrapper_addEntityFromSnbt(this.__wbg_ptr, ptr0, len0);
5451
+ if (ret[1]) {
5452
+ throw takeFromExternrefTable0(ret[0]);
5453
+ }
5454
+ }
5455
+ /**
5456
+ * @param {number} chunk_width
5457
+ * @param {number} chunk_height
5458
+ * @param {number} chunk_length
5062
5459
  * @param {string} strategy
5063
5460
  * @param {number} camera_x
5064
5461
  * @param {number} camera_y
@@ -5135,6 +5532,21 @@ export class SchematicWrapper {
5135
5532
  _assertClass(region, DefinitionRegionWrapper);
5136
5533
  wasm.schematicwrapper_addDefinitionRegion(this.__wbg_ptr, ptr0, len0, region.__wbg_ptr);
5137
5534
  }
5535
+ /**
5536
+ * Faithful, precision-safe block-entity read: the block entity's NBT as an
5537
+ * SNBT string (typed — `123L`, `1b`, etc.), or NULL if none. Unlike the
5538
+ * structured `nbt` object (which collapses `Long` to a JS double), SNBT
5539
+ * round-trips losslessly through `setBlockEntity`, so the editor can carry
5540
+ * untouched block entities verbatim.
5541
+ * @param {number} x
5542
+ * @param {number} y
5543
+ * @param {number} z
5544
+ * @returns {any}
5545
+ */
5546
+ getBlockEntitySnbt(x, y, z) {
5547
+ const ret = wasm.schematicwrapper_getBlockEntitySnbt(this.__wbg_ptr, x, y, z);
5548
+ return ret;
5549
+ }
5138
5550
  /**
5139
5551
  * @param {string} name
5140
5552
  * @returns {DefinitionRegionWrapper}
@@ -5170,6 +5582,14 @@ export class SchematicWrapper {
5170
5582
  throw takeFromExternrefTable0(ret[0]);
5171
5583
  }
5172
5584
  }
5585
+ /**
5586
+ * The canonical in-memory data version (the forward-conversion target).
5587
+ * @returns {number}
5588
+ */
5589
+ static canonicalDataVersion() {
5590
+ const ret = wasm.schematicwrapper_canonicalDataVersion();
5591
+ return ret;
5592
+ }
5173
5593
  /**
5174
5594
  * @returns {CircuitBuilderWrapper}
5175
5595
  */
@@ -5201,6 +5621,33 @@ export class SchematicWrapper {
5201
5621
  const ret = wasm.schematicwrapper_get_all_block_entities(this.__wbg_ptr);
5202
5622
  return ret;
5203
5623
  }
5624
+ /**
5625
+ * Convert this schematic's block states / block entities / items between
5626
+ * Minecraft data versions, in place, returning a JSON array describing any
5627
+ * data loss (empty `[]` when lossless).
5628
+ *
5629
+ * Forward (target >= source) is faithful and lossless — the report is always
5630
+ * `[]`. Reverse (target < source, used to save for an older version) can be
5631
+ * lossy (the 1.13 Flattening, 1.20.5 components, item `Damage`, …); each
5632
+ * approximation/drop is reported as `{version, kind, severity, path, detail}`
5633
+ * so the tool can warn the user before saving. Conversion is never silent
5634
+ * about loss.
5635
+ * @param {number} target_data_version
5636
+ * @param {number} source_data_version
5637
+ * @returns {string}
5638
+ */
5639
+ convertToDataVersion(target_data_version, source_data_version) {
5640
+ let deferred1_0;
5641
+ let deferred1_1;
5642
+ try {
5643
+ const ret = wasm.schematicwrapper_convertToDataVersion(this.__wbg_ptr, target_data_version, source_data_version);
5644
+ deferred1_0 = ret[0];
5645
+ deferred1_1 = ret[1];
5646
+ return getStringFromWasm0(ret[0], ret[1]);
5647
+ } finally {
5648
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
5649
+ }
5650
+ }
5204
5651
  /**
5205
5652
  * @param {string} name
5206
5653
  * @param {number} x
@@ -5215,6 +5662,17 @@ export class SchematicWrapper {
5215
5662
  throw takeFromExternrefTable0(ret[0]);
5216
5663
  }
5217
5664
  }
5665
+ /**
5666
+ * Graph-based detection: recovers **diagonal** lattice periods (e.g. a
5667
+ * diagonal carry-chain adder) that the pure-voxel `detectStructures` misses,
5668
+ * by extracting the redstone logic graph. Returns the same object shape.
5669
+ * Requires the `simulation` feature; returns `[]` for non-redstone builds.
5670
+ * @returns {any}
5671
+ */
5672
+ detectStructuresGraph() {
5673
+ const ret = wasm.schematicwrapper_detectStructuresGraph(this.__wbg_ptr);
5674
+ return ret;
5675
+ }
5218
5676
  /**
5219
5677
  * @param {string} region_name
5220
5678
  * @returns {any}
@@ -5235,6 +5693,24 @@ export class SchematicWrapper {
5235
5693
  const ret = wasm.schematicwrapper_get_region_bounding_box(this.__wbg_ptr, ptr0, len0);
5236
5694
  return ret;
5237
5695
  }
5696
+ /**
5697
+ * The Minecraft data version of the file this schematic was loaded from
5698
+ * (captured by importers), or `None` for versionless/freshly-built schematics.
5699
+ * @returns {number | undefined}
5700
+ */
5701
+ getSourceDataVersion() {
5702
+ const ret = wasm.schematicwrapper_getSourceDataVersion(this.__wbg_ptr);
5703
+ return ret === 0x100000001 ? undefined : ret;
5704
+ }
5705
+ /**
5706
+ * Override the source data version — for formats that carry no Java data
5707
+ * version (classic `.schematic` ≈ 1343, raw imports), so the caller can tell
5708
+ * the converter what to convert *from*.
5709
+ * @param {number} version
5710
+ */
5711
+ setSourceDataVersion(version) {
5712
+ wasm.schematicwrapper_setSourceDataVersion(this.__wbg_ptr, version);
5713
+ }
5238
5714
  /**
5239
5715
  * @param {string} name
5240
5716
  */
@@ -5279,6 +5755,23 @@ export class SchematicWrapper {
5279
5755
  const ret = wasm.schematicwrapper_removeDefinitionRegion(this.__wbg_ptr, ptr0, len0);
5280
5756
  return ret !== 0;
5281
5757
  }
5758
+ /**
5759
+ * Serialize a `.litematic` targeting a specific Minecraft data version: a COPY
5760
+ * of the schematic's content is converted to `target_data_version` and the
5761
+ * matching schematic Version header (4=1.12 / 5=1.13–1.17 / 6=1.18–1.20.4 /
5762
+ * 7=1.20.5+) is written. Returns `{ bytes: Uint8Array, loss: <json> }`; `loss`
5763
+ * is the data-loss report from any down-conversion (empty `{}` when lossless),
5764
+ * so the UI can warn the user. The schematic itself is left unchanged.
5765
+ * @param {number} target_data_version
5766
+ * @returns {any}
5767
+ */
5768
+ toLitematicForVersion(target_data_version) {
5769
+ const ret = wasm.schematicwrapper_toLitematicForVersion(this.__wbg_ptr, target_data_version);
5770
+ if (ret[2]) {
5771
+ throw takeFromExternrefTable0(ret[1]);
5772
+ }
5773
+ return takeFromExternrefTable0(ret[0]);
5774
+ }
5282
5775
  /**
5283
5776
  * @param {number} x
5284
5777
  * @param {number} y
@@ -5388,6 +5881,18 @@ export class SchematicWrapper {
5388
5881
  throw takeFromExternrefTable0(ret[0]);
5389
5882
  }
5390
5883
  }
5884
+ /**
5885
+ * Every block entity as `{id, position:[x,y,z], snbt}` — the batch,
5886
+ * precision-faithful read the editor bridge uses on load to attach each
5887
+ * block entity's full NBT (as a typed SNBT string) to its block. The `snbt`
5888
+ * is the block entity's inner data only (no `Id`/`Pos`); pair it with `id`
5889
+ * and the position when writing back via `setBlockEntity`.
5890
+ * @returns {Array<any>}
5891
+ */
5892
+ getAllBlockEntitiesSnbt() {
5893
+ const ret = wasm.schematicwrapper_getAllBlockEntitiesSnbt(this.__wbg_ptr);
5894
+ return ret;
5895
+ }
5391
5896
  /**
5392
5897
  * @returns {Array<any>}
5393
5898
  */
@@ -5576,6 +6081,22 @@ export class SchematicWrapper {
5576
6081
  throw takeFromExternrefTable0(ret[0]);
5577
6082
  }
5578
6083
  }
6084
+ /**
6085
+ * Replace this schematic by sampling an SDF JSON tree with material
6086
+ * rules JSON (auto bounds from the tree's AABB).
6087
+ * @param {string} sdf_json
6088
+ * @param {string} rules_json
6089
+ */
6090
+ fromSdf(sdf_json, rules_json) {
6091
+ const ptr0 = passStringToWasm0(sdf_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6092
+ const len0 = WASM_VECTOR_LEN;
6093
+ const ptr1 = passStringToWasm0(rules_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6094
+ const len1 = WASM_VECTOR_LEN;
6095
+ const ret = wasm.schematicwrapper_fromSdf(this.__wbg_ptr, ptr0, len0, ptr1, len1);
6096
+ if (ret[1]) {
6097
+ throw takeFromExternrefTable0(ret[0]);
6098
+ }
6099
+ }
5579
6100
  /**
5580
6101
  * @returns {string | undefined}
5581
6102
  */
@@ -5670,55 +6191,6 @@ export class SchematicWrapper {
5670
6191
  const len0 = WASM_VECTOR_LEN;
5671
6192
  wasm.schematicwrapper_set_block(this.__wbg_ptr, x, y, z, ptr0, len0);
5672
6193
  }
5673
- /**
5674
- * Structurally diff this schematic against `other`.
5675
- *
5676
- * `preset` defaults to `"exact"`. `options` is an optional object
5677
- * `{cost_add?, cost_delete?, cost_change?, cost_swap?, symmetry?}`.
5678
- * Returns a [`DiffWrapper`]. Unknown preset/symmetry → Err.
5679
- * @param {SchematicWrapper} other
5680
- * @param {string | null | undefined} preset
5681
- * @param {any} options
5682
- * @returns {DiffWrapper}
5683
- */
5684
- diff(other, preset, options) {
5685
- _assertClass(other, SchematicWrapper);
5686
- var ptr0 = isLikeNone(preset) ? 0 : passStringToWasm0(preset, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5687
- var len0 = WASM_VECTOR_LEN;
5688
- const ret = wasm.schematicwrapper_diff(this.__wbg_ptr, other.__wbg_ptr, ptr0, len0, options);
5689
- if (ret[2]) {
5690
- throw takeFromExternrefTable0(ret[1]);
5691
- }
5692
- return DiffWrapper.__wrap(ret[0]);
5693
- }
5694
- /**
5695
- * Creates a simulation world for this schematic with default options
5696
- *
5697
- * This allows you to simulate redstone circuits and interact with them.
5698
- * @returns {MchprsWorldWrapper}
5699
- */
5700
- create_simulation_world() {
5701
- const ret = wasm.schematicwrapper_create_simulation_world(this.__wbg_ptr);
5702
- if (ret[2]) {
5703
- throw takeFromExternrefTable0(ret[1]);
5704
- }
5705
- return MchprsWorldWrapper.__wrap(ret[0]);
5706
- }
5707
- /**
5708
- * Creates a simulation world for this schematic with custom options
5709
- *
5710
- * This allows you to configure simulation behavior like wire state tracking.
5711
- * @param {SimulationOptionsWrapper} options
5712
- * @returns {MchprsWorldWrapper}
5713
- */
5714
- create_simulation_world_with_options(options) {
5715
- _assertClass(options, SimulationOptionsWrapper);
5716
- const ret = wasm.schematicwrapper_create_simulation_world_with_options(this.__wbg_ptr, options.__wbg_ptr);
5717
- if (ret[2]) {
5718
- throw takeFromExternrefTable0(ret[1]);
5719
- }
5720
- return MchprsWorldWrapper.__wrap(ret[0]);
5721
- }
5722
6194
  /**
5723
6195
  * Generate raw mesh data for custom rendering pipelines.
5724
6196
  * @param {ResourcePackWrapper} pack
@@ -6325,7 +6797,7 @@ export class SortStrategyWrapper {
6325
6797
  * @returns {SortStrategyWrapper}
6326
6798
  */
6327
6799
  static zyx() {
6328
- const ret = wasm.sortstrategywrapper_zyx();
6800
+ const ret = wasm.iotypewrapper_float32();
6329
6801
  return SortStrategyWrapper.__wrap(ret);
6330
6802
  }
6331
6803
  /**
@@ -6375,7 +6847,7 @@ export class SortStrategyWrapper {
6375
6847
  * @returns {SortStrategyWrapper}
6376
6848
  */
6377
6849
  static yDescXZ() {
6378
- const ret = wasm.sortstrategywrapper_yDescXZ();
6850
+ const ret = wasm.iotypewrapper_boolean();
6379
6851
  return SortStrategyWrapper.__wrap(ret);
6380
6852
  }
6381
6853
  /**
@@ -7072,6 +7544,243 @@ export class WasmBuildingTool {
7072
7544
  }
7073
7545
  if (Symbol.dispose) WasmBuildingTool.prototype[Symbol.dispose] = WasmBuildingTool.prototype.free;
7074
7546
 
7547
+ export class WorldChunkIterWrapper {
7548
+ static __wrap(ptr) {
7549
+ ptr = ptr >>> 0;
7550
+ const obj = Object.create(WorldChunkIterWrapper.prototype);
7551
+ obj.__wbg_ptr = ptr;
7552
+ WorldChunkIterWrapperFinalization.register(obj, obj.__wbg_ptr, obj);
7553
+ return obj;
7554
+ }
7555
+ __destroy_into_raw() {
7556
+ const ptr = this.__wbg_ptr;
7557
+ this.__wbg_ptr = 0;
7558
+ WorldChunkIterWrapperFinalization.unregister(this);
7559
+ return ptr;
7560
+ }
7561
+ free() {
7562
+ const ptr = this.__destroy_into_raw();
7563
+ wasm.__wbg_worldchunkiterwrapper_free(ptr, 0);
7564
+ }
7565
+ /**
7566
+ * Returns the next chunk, or `null`/`undefined` at the end of the stream.
7567
+ * Throws if the chunk is corrupt or unreadable.
7568
+ * @returns {WorldChunkViewWrapper | undefined}
7569
+ */
7570
+ next() {
7571
+ const ret = wasm.worldchunkiterwrapper_next(this.__wbg_ptr);
7572
+ if (ret[2]) {
7573
+ throw takeFromExternrefTable0(ret[1]);
7574
+ }
7575
+ return ret[0] === 0 ? undefined : WorldChunkViewWrapper.__wrap(ret[0]);
7576
+ }
7577
+ /**
7578
+ * @returns {boolean}
7579
+ */
7580
+ has_next() {
7581
+ const ret = wasm.worldchunkiterwrapper_has_next(this.__wbg_ptr);
7582
+ return ret !== 0;
7583
+ }
7584
+ }
7585
+ if (Symbol.dispose) WorldChunkIterWrapper.prototype[Symbol.dispose] = WorldChunkIterWrapper.prototype.free;
7586
+
7587
+ export class WorldChunkViewWrapper {
7588
+ static __wrap(ptr) {
7589
+ ptr = ptr >>> 0;
7590
+ const obj = Object.create(WorldChunkViewWrapper.prototype);
7591
+ obj.__wbg_ptr = ptr;
7592
+ WorldChunkViewWrapperFinalization.register(obj, obj.__wbg_ptr, obj);
7593
+ return obj;
7594
+ }
7595
+ __destroy_into_raw() {
7596
+ const ptr = this.__wbg_ptr;
7597
+ this.__wbg_ptr = 0;
7598
+ WorldChunkViewWrapperFinalization.unregister(this);
7599
+ return ptr;
7600
+ }
7601
+ free() {
7602
+ const ptr = this.__destroy_into_raw();
7603
+ wasm.__wbg_worldchunkviewwrapper_free(ptr, 0);
7604
+ }
7605
+ /**
7606
+ * @returns {SchematicWrapper}
7607
+ */
7608
+ to_schematic() {
7609
+ const ret = wasm.worldchunkviewwrapper_to_schematic(this.__wbg_ptr);
7610
+ return SchematicWrapper.__wrap(ret);
7611
+ }
7612
+ /**
7613
+ * Deduped union of all sections' biome palette entries, in order of
7614
+ * first appearance. Empty if no section carries biome data.
7615
+ * @returns {string[]}
7616
+ */
7617
+ biome_palette() {
7618
+ const ret = wasm.worldchunkviewwrapper_biome_palette(this.__wbg_ptr);
7619
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
7620
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
7621
+ return v1;
7622
+ }
7623
+ /**
7624
+ * @returns {number}
7625
+ */
7626
+ cx() {
7627
+ const ret = wasm.worldchunkviewwrapper_cx(this.__wbg_ptr);
7628
+ return ret;
7629
+ }
7630
+ /**
7631
+ * @returns {number}
7632
+ */
7633
+ cz() {
7634
+ const ret = wasm.worldchunkviewwrapper_cz(this.__wbg_ptr);
7635
+ return ret;
7636
+ }
7637
+ /**
7638
+ * Create an empty chunk at the given chunk coordinates — the starting
7639
+ * point for generating chunks from scratch. Sections are created on
7640
+ * demand by `set_block`. In WASM there is no `WorldSink` (no filesystem),
7641
+ * so fabricated chunks are used via `to_schematic()` or direct inspection
7642
+ * (`get_block`, `y_range`, ...).
7643
+ * @param {number} cx
7644
+ * @param {number} cz
7645
+ */
7646
+ constructor(cx, cz) {
7647
+ const ret = wasm.worldchunkviewwrapper_new(cx, cz);
7648
+ this.__wbg_ptr = ret >>> 0;
7649
+ WorldChunkViewWrapperFinalization.register(this, this.__wbg_ptr, this);
7650
+ return this;
7651
+ }
7652
+ /**
7653
+ * Returns `[min_y, max_y]` (inclusive on both ends).
7654
+ * @returns {Int32Array}
7655
+ */
7656
+ y_range() {
7657
+ const ret = wasm.worldchunkviewwrapper_y_range(this.__wbg_ptr);
7658
+ var v1 = getArrayI32FromWasm0(ret[0], ret[1]).slice();
7659
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
7660
+ return v1;
7661
+ }
7662
+ /**
7663
+ * Returns the block name at world coordinates (e.g. `"minecraft:air"` for air cells),
7664
+ * or `undefined`/`null` if the coordinates fall outside the chunk's loaded sections.
7665
+ * @param {number} x
7666
+ * @param {number} y
7667
+ * @param {number} z
7668
+ * @returns {string | undefined}
7669
+ */
7670
+ get_block(x, y, z) {
7671
+ const ret = wasm.worldchunkviewwrapper_get_block(this.__wbg_ptr, x, y, z);
7672
+ let v1;
7673
+ if (ret[0] !== 0) {
7674
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
7675
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
7676
+ }
7677
+ return v1;
7678
+ }
7679
+ /**
7680
+ * Overwrite the biome of every currently-present section with
7681
+ * `biome_name` (e.g. `"minecraft:desert"`). Sections are created lazily
7682
+ * by `set_block`, so call this AFTER placing blocks. Coarse chunk-level
7683
+ * control; existing multi-biome data round-trips losslessly if you
7684
+ * don't call this.
7685
+ * @param {string} biome_name
7686
+ */
7687
+ set_biome(biome_name) {
7688
+ const ptr0 = passStringToWasm0(biome_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7689
+ const len0 = WASM_VECTOR_LEN;
7690
+ wasm.worldchunkviewwrapper_set_biome(this.__wbg_ptr, ptr0, len0);
7691
+ }
7692
+ /**
7693
+ * Set the block at world coordinates `(x, y, z)` by name. Returns `true`
7694
+ * on success, `false` if `(x, z)` falls outside this chunk. Creates the
7695
+ * section if the Y level has none.
7696
+ * @param {number} x
7697
+ * @param {number} y
7698
+ * @param {number} z
7699
+ * @param {string} block_name
7700
+ * @returns {boolean}
7701
+ */
7702
+ set_block(x, y, z, block_name) {
7703
+ const ptr0 = passStringToWasm0(block_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7704
+ const len0 = WASM_VECTOR_LEN;
7705
+ const ret = wasm.worldchunkviewwrapper_set_block(this.__wbg_ptr, x, y, z, ptr0, len0);
7706
+ return ret !== 0;
7707
+ }
7708
+ }
7709
+ if (Symbol.dispose) WorldChunkViewWrapper.prototype[Symbol.dispose] = WorldChunkViewWrapper.prototype.free;
7710
+
7711
+ export class WorldSourceWrapper {
7712
+ static __wrap(ptr) {
7713
+ ptr = ptr >>> 0;
7714
+ const obj = Object.create(WorldSourceWrapper.prototype);
7715
+ obj.__wbg_ptr = ptr;
7716
+ WorldSourceWrapperFinalization.register(obj, obj.__wbg_ptr, obj);
7717
+ return obj;
7718
+ }
7719
+ __destroy_into_raw() {
7720
+ const ptr = this.__wbg_ptr;
7721
+ this.__wbg_ptr = 0;
7722
+ WorldSourceWrapperFinalization.unregister(this);
7723
+ return ptr;
7724
+ }
7725
+ free() {
7726
+ const ptr = this.__destroy_into_raw();
7727
+ wasm.__wbg_worldsourcewrapper_free(ptr, 0);
7728
+ }
7729
+ /**
7730
+ * @param {number} min_x
7731
+ * @param {number} min_y
7732
+ * @param {number} min_z
7733
+ * @param {number} max_x
7734
+ * @param {number} max_y
7735
+ * @param {number} max_z
7736
+ * @returns {WorldChunkIterWrapper}
7737
+ */
7738
+ chunks_bounded(min_x, min_y, min_z, max_x, max_y, max_z) {
7739
+ const ret = wasm.worldsourcewrapper_chunks_bounded(this.__wbg_ptr, min_x, min_y, min_z, max_x, max_y, max_z);
7740
+ if (ret[2]) {
7741
+ throw takeFromExternrefTable0(ret[1]);
7742
+ }
7743
+ return WorldChunkIterWrapper.__wrap(ret[0]);
7744
+ }
7745
+ /**
7746
+ * @param {Uint8Array} data
7747
+ * @returns {WorldSourceWrapper}
7748
+ */
7749
+ static from_mca_bytes(data) {
7750
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
7751
+ const len0 = WASM_VECTOR_LEN;
7752
+ const ret = wasm.worldsourcewrapper_from_mca_bytes(ptr0, len0);
7753
+ if (ret[2]) {
7754
+ throw takeFromExternrefTable0(ret[1]);
7755
+ }
7756
+ return WorldSourceWrapper.__wrap(ret[0]);
7757
+ }
7758
+ /**
7759
+ * @param {Uint8Array} data
7760
+ * @returns {WorldSourceWrapper}
7761
+ */
7762
+ static from_zip_bytes(data) {
7763
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
7764
+ const len0 = WASM_VECTOR_LEN;
7765
+ const ret = wasm.worldsourcewrapper_from_zip_bytes(ptr0, len0);
7766
+ if (ret[2]) {
7767
+ throw takeFromExternrefTable0(ret[1]);
7768
+ }
7769
+ return WorldSourceWrapper.__wrap(ret[0]);
7770
+ }
7771
+ /**
7772
+ * @returns {WorldChunkIterWrapper}
7773
+ */
7774
+ chunks() {
7775
+ const ret = wasm.worldsourcewrapper_chunks(this.__wbg_ptr);
7776
+ if (ret[2]) {
7777
+ throw takeFromExternrefTable0(ret[1]);
7778
+ }
7779
+ return WorldChunkIterWrapper.__wrap(ret[0]);
7780
+ }
7781
+ }
7782
+ if (Symbol.dispose) WorldSourceWrapper.prototype[Symbol.dispose] = WorldSourceWrapper.prototype.free;
7783
+
7075
7784
  /**
7076
7785
  * Build a resource pack ZIP from multiple item model results.
7077
7786
  *
@@ -7203,6 +7912,24 @@ export function get_easing_functions() {
7203
7912
  return ret;
7204
7913
  }
7205
7914
 
7915
+ /**
7916
+ * Evaluate an SDF JSON tree at a point; returns the signed distance.
7917
+ * @param {string} sdf_json
7918
+ * @param {number} x
7919
+ * @param {number} y
7920
+ * @param {number} z
7921
+ * @returns {number}
7922
+ */
7923
+ export function sdfEval(sdf_json, x, y, z) {
7924
+ const ptr0 = passStringToWasm0(sdf_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7925
+ const len0 = WASM_VECTOR_LEN;
7926
+ const ret = wasm.sdfEval(ptr0, len0, x, y, z);
7927
+ if (ret[2]) {
7928
+ throw takeFromExternrefTable0(ret[1]);
7929
+ }
7930
+ return ret[0];
7931
+ }
7932
+
7206
7933
  /**
7207
7934
  * @param {string[]} block_ids
7208
7935
  * @returns {any}
@@ -7333,6 +8060,10 @@ function __wbg_get_imports() {
7333
8060
  const ret = arg0.call(arg1, arg2, arg3);
7334
8061
  return ret;
7335
8062
  }, arguments) };
8063
+ imports.wbg.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
8064
+ const ret = arg0.crypto;
8065
+ return ret;
8066
+ };
7336
8067
  imports.wbg.__wbg_entries_83c79938054e065f = function(arg0) {
7337
8068
  const ret = Object.entries(arg0);
7338
8069
  return ret;
@@ -7355,6 +8086,9 @@ function __wbg_get_imports() {
7355
8086
  const ret = Array.from(arg0);
7356
8087
  return ret;
7357
8088
  };
8089
+ imports.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
8090
+ arg0.getRandomValues(arg1);
8091
+ }, arguments) };
7358
8092
  imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
7359
8093
  const ret = arg0[arg1 >>> 0];
7360
8094
  return ret;
@@ -7406,6 +8140,10 @@ function __wbg_get_imports() {
7406
8140
  imports.wbg.__wbg_log_1d990106d99dacb7 = function(arg0) {
7407
8141
  console.log(arg0);
7408
8142
  };
8143
+ imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
8144
+ const ret = arg0.msCrypto;
8145
+ return ret;
8146
+ };
7409
8147
  imports.wbg.__wbg_new_1ba21ce319a06297 = function() {
7410
8148
  const ret = new Object();
7411
8149
  return ret;
@@ -7442,6 +8180,10 @@ function __wbg_get_imports() {
7442
8180
  const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
7443
8181
  return ret;
7444
8182
  };
8183
+ imports.wbg.__wbg_new_no_args_cb138f77cf6151ee = function(arg0, arg1) {
8184
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
8185
+ return ret;
8186
+ };
7445
8187
  imports.wbg.__wbg_new_with_length_12c6de4fac33117a = function(arg0) {
7446
8188
  const ret = new Array(arg0 >>> 0);
7447
8189
  return ret;
@@ -7450,6 +8192,10 @@ function __wbg_get_imports() {
7450
8192
  const ret = new Uint8Array(arg0 >>> 0);
7451
8193
  return ret;
7452
8194
  };
8195
+ imports.wbg.__wbg_node_905d3e251edff8a2 = function(arg0) {
8196
+ const ret = arg0.node;
8197
+ return ret;
8198
+ };
7453
8199
  imports.wbg.__wbg_now_69d776cd24f5215b = function() {
7454
8200
  const ret = Date.now();
7455
8201
  return ret;
@@ -7458,6 +8204,14 @@ function __wbg_get_imports() {
7458
8204
  const ret = Array.of(arg0, arg1, arg2);
7459
8205
  return ret;
7460
8206
  };
8207
+ imports.wbg.__wbg_parse_a09a54cf72639456 = function() { return handleError(function (arg0, arg1) {
8208
+ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
8209
+ return ret;
8210
+ }, arguments) };
8211
+ imports.wbg.__wbg_process_dc0fbacc7c1c06f7 = function(arg0) {
8212
+ const ret = arg0.process;
8213
+ return ret;
8214
+ };
7461
8215
  imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
7462
8216
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
7463
8217
  };
@@ -7465,6 +8219,13 @@ function __wbg_get_imports() {
7465
8219
  const ret = arg0.push(arg1);
7466
8220
  return ret;
7467
8221
  };
8222
+ imports.wbg.__wbg_randomFillSync_ac0988aba3254290 = function() { return handleError(function (arg0, arg1) {
8223
+ arg0.randomFillSync(arg1);
8224
+ }, arguments) };
8225
+ imports.wbg.__wbg_require_60cc747a6bc5215a = function() { return handleError(function () {
8226
+ const ret = module.require;
8227
+ return ret;
8228
+ }, arguments) };
7468
8229
  imports.wbg.__wbg_set_169e13b608078b7b = function(arg0, arg1, arg2) {
7469
8230
  arg0.set(getArrayU8FromWasm0(arg1, arg2));
7470
8231
  };
@@ -7492,6 +8253,30 @@ function __wbg_get_imports() {
7492
8253
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
7493
8254
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
7494
8255
  };
8256
+ imports.wbg.__wbg_static_accessor_GLOBAL_769e6b65d6557335 = function() {
8257
+ const ret = typeof global === 'undefined' ? null : global;
8258
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
8259
+ };
8260
+ imports.wbg.__wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1 = function() {
8261
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
8262
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
8263
+ };
8264
+ imports.wbg.__wbg_static_accessor_SELF_08f5a74c69739274 = function() {
8265
+ const ret = typeof self === 'undefined' ? null : self;
8266
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
8267
+ };
8268
+ imports.wbg.__wbg_static_accessor_WINDOW_a8924b26aa92d024 = function() {
8269
+ const ret = typeof window === 'undefined' ? null : window;
8270
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
8271
+ };
8272
+ imports.wbg.__wbg_subarray_845f2f5bce7d061a = function(arg0, arg1, arg2) {
8273
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
8274
+ return ret;
8275
+ };
8276
+ imports.wbg.__wbg_versions_c01dfd4722a88165 = function(arg0) {
8277
+ const ret = arg0.versions;
8278
+ return ret;
8279
+ };
7495
8280
  imports.wbg.__wbg_warn_6e567d0d926ff881 = function(arg0) {
7496
8281
  console.warn(arg0);
7497
8282
  };
@@ -7510,6 +8295,11 @@ function __wbg_get_imports() {
7510
8295
  const ret = arg0;
7511
8296
  return ret;
7512
8297
  };
8298
+ imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
8299
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
8300
+ const ret = getArrayU8FromWasm0(arg0, arg1);
8301
+ return ret;
8302
+ };
7513
8303
  imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
7514
8304
  // Cast intrinsic for `F64 -> Externref`.
7515
8305
  const ret = arg0;