nucleation 0.1.82 → 0.1.84

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.
@@ -225,6 +225,11 @@ function getArrayJsValueFromWasm0(ptr, len) {
225
225
  wasm.__externref_drop_slice(ptr, len);
226
226
  return result;
227
227
  }
228
+
229
+ export function start() {
230
+ wasm.start();
231
+ }
232
+
228
233
  /**
229
234
  * @param {SchematicWrapper} schematic
230
235
  * @returns {string}
@@ -243,10 +248,6 @@ export function debug_json_schematic(schematic) {
243
248
  }
244
249
  }
245
250
 
246
- export function start() {
247
- wasm.start();
248
- }
249
-
250
251
  /**
251
252
  * @param {SchematicWrapper} schematic
252
253
  * @returns {string}
@@ -971,6 +972,45 @@ export class SchematicWrapper {
971
972
  const ret = wasm.schematicwrapper_chunks_with_strategy(this.__wbg_ptr, chunk_width, chunk_height, chunk_length, ptr0, len0, camera_x, camera_y, camera_z);
972
973
  return ret;
973
974
  }
975
+ /**
976
+ * Get the tight bounding box max coordinates [x, y, z]
977
+ * Returns null if no non-air blocks have been placed
978
+ * @returns {Int32Array | undefined}
979
+ */
980
+ get_tight_bounds_max() {
981
+ const ret = wasm.schematicwrapper_get_tight_bounds_max(this.__wbg_ptr);
982
+ let v1;
983
+ if (ret[0] !== 0) {
984
+ v1 = getArrayI32FromWasm0(ret[0], ret[1]).slice();
985
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
986
+ }
987
+ return v1;
988
+ }
989
+ /**
990
+ * Get the tight bounding box min coordinates [x, y, z]
991
+ * Returns null if no non-air blocks have been placed
992
+ * @returns {Int32Array | undefined}
993
+ */
994
+ get_tight_bounds_min() {
995
+ const ret = wasm.schematicwrapper_get_tight_bounds_min(this.__wbg_ptr);
996
+ let v1;
997
+ if (ret[0] !== 0) {
998
+ v1 = getArrayI32FromWasm0(ret[0], ret[1]).slice();
999
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1000
+ }
1001
+ return v1;
1002
+ }
1003
+ /**
1004
+ * Get the tight dimensions of actual block content (excluding pre-allocated space)
1005
+ * Returns [width, height, length] or [0, 0, 0] if no non-air blocks exist
1006
+ * @returns {Int32Array}
1007
+ */
1008
+ get_tight_dimensions() {
1009
+ const ret = wasm.schematicwrapper_get_tight_dimensions(this.__wbg_ptr);
1010
+ var v1 = getArrayI32FromWasm0(ret[0], ret[1]).slice();
1011
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1012
+ return v1;
1013
+ }
974
1014
  /**
975
1015
  * @param {string} version
976
1016
  * @returns {Uint8Array}
package/nucleation.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function debug_json_schematic(schematic: SchematicWrapper): string;
4
3
  export function start(): void;
4
+ export function debug_json_schematic(schematic: SchematicWrapper): string;
5
5
  export function debug_schematic(schematic: SchematicWrapper): string;
6
6
  export class BlockPosition {
7
7
  free(): void;
@@ -160,6 +160,21 @@ export class SchematicWrapper {
160
160
  get_chunk_blocks(offset_x: number, offset_y: number, offset_z: number, width: number, height: number, length: number): Array<any>;
161
161
  get_region_names(): string[];
162
162
  chunks_with_strategy(chunk_width: number, chunk_height: number, chunk_length: number, strategy: string, camera_x: number, camera_y: number, camera_z: number): Array<any>;
163
+ /**
164
+ * Get the tight bounding box max coordinates [x, y, z]
165
+ * Returns null if no non-air blocks have been placed
166
+ */
167
+ get_tight_bounds_max(): Int32Array | undefined;
168
+ /**
169
+ * Get the tight bounding box min coordinates [x, y, z]
170
+ * Returns null if no non-air blocks have been placed
171
+ */
172
+ get_tight_bounds_min(): Int32Array | undefined;
173
+ /**
174
+ * Get the tight dimensions of actual block content (excluding pre-allocated space)
175
+ * Returns [width, height, length] or [0, 0, 0] if no non-air blocks exist
176
+ */
177
+ get_tight_dimensions(): Int32Array;
163
178
  to_schematic_version(version: string): Uint8Array;
164
179
  /**
165
180
  * Get optimization stats
@@ -248,14 +263,6 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
248
263
 
249
264
  export interface InitOutput {
250
265
  readonly memory: WebAssembly.Memory;
251
- readonly __wbg_blockposition_free: (a: number, b: number) => void;
252
- readonly __wbg_get_blockposition_x: (a: number) => number;
253
- readonly __wbg_get_blockposition_y: (a: number) => number;
254
- readonly __wbg_get_blockposition_z: (a: number) => number;
255
- readonly __wbg_set_blockposition_x: (a: number, b: number) => void;
256
- readonly __wbg_set_blockposition_y: (a: number, b: number) => void;
257
- readonly __wbg_set_blockposition_z: (a: number, b: number) => void;
258
- readonly blockposition_new: (a: number, b: number, c: number) => number;
259
266
  readonly __wbg_blockstatewrapper_free: (a: number, b: number) => void;
260
267
  readonly __wbg_lazychunkiterator_free: (a: number, b: number) => void;
261
268
  readonly __wbg_mchprsworldwrapper_free: (a: number, b: number) => void;
@@ -323,6 +330,9 @@ export interface InitOutput {
323
330
  readonly schematicwrapper_get_palette_from_region: (a: number, b: number, c: number) => any;
324
331
  readonly schematicwrapper_get_region_bounding_box: (a: number, b: number, c: number) => any;
325
332
  readonly schematicwrapper_get_region_names: (a: number) => [number, number];
333
+ readonly schematicwrapper_get_tight_bounds_max: (a: number) => [number, number];
334
+ readonly schematicwrapper_get_tight_bounds_min: (a: number) => [number, number];
335
+ readonly schematicwrapper_get_tight_dimensions: (a: number) => [number, number];
326
336
  readonly schematicwrapper_get_volume: (a: number) => number;
327
337
  readonly schematicwrapper_new: () => number;
328
338
  readonly schematicwrapper_print_schematic: (a: number) => [number, number];
@@ -347,6 +357,14 @@ export interface InitOutput {
347
357
  readonly schematicwrapper_create_simulation_world_with_options: (a: number, b: number) => [number, number, number];
348
358
  readonly schematicwrapper_create_simulation_world: (a: number) => [number, number, number];
349
359
  readonly start: () => void;
360
+ readonly __wbg_blockposition_free: (a: number, b: number) => void;
361
+ readonly __wbg_get_blockposition_x: (a: number) => number;
362
+ readonly __wbg_get_blockposition_y: (a: number) => number;
363
+ readonly __wbg_get_blockposition_z: (a: number) => number;
364
+ readonly __wbg_set_blockposition_x: (a: number, b: number) => void;
365
+ readonly __wbg_set_blockposition_y: (a: number, b: number) => void;
366
+ readonly __wbg_set_blockposition_z: (a: number, b: number) => void;
367
+ readonly blockposition_new: (a: number, b: number, c: number) => number;
350
368
  readonly __wbindgen_malloc: (a: number, b: number) => number;
351
369
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
352
370
  readonly __wbindgen_exn_store: (a: number) => void;
Binary file
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "Nano nano@schem.at"
6
6
  ],
7
7
  "description": "A high-performance Minecraft schematic parser and utility library",
8
- "version": "0.1.82",
8
+ "version": "0.1.84",
9
9
  "license": "AGPL-3.0-only",
10
10
  "repository": {
11
11
  "type": "git",