nucleation 0.1.81 → 0.1.83
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/nucleation-original.js +43 -4
- package/nucleation.d.ts +28 -10
- package/nucleation_bg.wasm +0 -0
- package/package.json +1 -1
package/nucleation-original.js
CHANGED
|
@@ -229,12 +229,12 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
229
229
|
* @param {SchematicWrapper} schematic
|
|
230
230
|
* @returns {string}
|
|
231
231
|
*/
|
|
232
|
-
export function
|
|
232
|
+
export function debug_json_schematic(schematic) {
|
|
233
233
|
let deferred1_0;
|
|
234
234
|
let deferred1_1;
|
|
235
235
|
try {
|
|
236
236
|
_assertClass(schematic, SchematicWrapper);
|
|
237
|
-
const ret = wasm.
|
|
237
|
+
const ret = wasm.debug_json_schematic(schematic.__wbg_ptr);
|
|
238
238
|
deferred1_0 = ret[0];
|
|
239
239
|
deferred1_1 = ret[1];
|
|
240
240
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
@@ -251,12 +251,12 @@ export function start() {
|
|
|
251
251
|
* @param {SchematicWrapper} schematic
|
|
252
252
|
* @returns {string}
|
|
253
253
|
*/
|
|
254
|
-
export function
|
|
254
|
+
export function debug_schematic(schematic) {
|
|
255
255
|
let deferred1_0;
|
|
256
256
|
let deferred1_1;
|
|
257
257
|
try {
|
|
258
258
|
_assertClass(schematic, SchematicWrapper);
|
|
259
|
-
const ret = wasm.
|
|
259
|
+
const ret = wasm.debug_schematic(schematic.__wbg_ptr);
|
|
260
260
|
deferred1_0 = ret[0];
|
|
261
261
|
deferred1_1 = ret[1];
|
|
262
262
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
@@ -971,6 +971,45 @@ export class SchematicWrapper {
|
|
|
971
971
|
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
972
|
return ret;
|
|
973
973
|
}
|
|
974
|
+
/**
|
|
975
|
+
* Get the tight bounding box max coordinates [x, y, z]
|
|
976
|
+
* Returns null if no non-air blocks have been placed
|
|
977
|
+
* @returns {Int32Array | undefined}
|
|
978
|
+
*/
|
|
979
|
+
get_tight_bounds_max() {
|
|
980
|
+
const ret = wasm.schematicwrapper_get_tight_bounds_max(this.__wbg_ptr);
|
|
981
|
+
let v1;
|
|
982
|
+
if (ret[0] !== 0) {
|
|
983
|
+
v1 = getArrayI32FromWasm0(ret[0], ret[1]).slice();
|
|
984
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
985
|
+
}
|
|
986
|
+
return v1;
|
|
987
|
+
}
|
|
988
|
+
/**
|
|
989
|
+
* Get the tight bounding box min coordinates [x, y, z]
|
|
990
|
+
* Returns null if no non-air blocks have been placed
|
|
991
|
+
* @returns {Int32Array | undefined}
|
|
992
|
+
*/
|
|
993
|
+
get_tight_bounds_min() {
|
|
994
|
+
const ret = wasm.schematicwrapper_get_tight_bounds_min(this.__wbg_ptr);
|
|
995
|
+
let v1;
|
|
996
|
+
if (ret[0] !== 0) {
|
|
997
|
+
v1 = getArrayI32FromWasm0(ret[0], ret[1]).slice();
|
|
998
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
999
|
+
}
|
|
1000
|
+
return v1;
|
|
1001
|
+
}
|
|
1002
|
+
/**
|
|
1003
|
+
* Get the tight dimensions of actual block content (excluding pre-allocated space)
|
|
1004
|
+
* Returns [width, height, length] or [0, 0, 0] if no non-air blocks exist
|
|
1005
|
+
* @returns {Int32Array}
|
|
1006
|
+
*/
|
|
1007
|
+
get_tight_dimensions() {
|
|
1008
|
+
const ret = wasm.schematicwrapper_get_tight_dimensions(this.__wbg_ptr);
|
|
1009
|
+
var v1 = getArrayI32FromWasm0(ret[0], ret[1]).slice();
|
|
1010
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1011
|
+
return v1;
|
|
1012
|
+
}
|
|
974
1013
|
/**
|
|
975
1014
|
* @param {string} version
|
|
976
1015
|
* @returns {Uint8Array}
|
package/nucleation.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
export function debug_schematic(schematic: SchematicWrapper): string;
|
|
4
|
-
export function start(): void;
|
|
5
3
|
export function debug_json_schematic(schematic: SchematicWrapper): string;
|
|
4
|
+
export function start(): void;
|
|
5
|
+
export function debug_schematic(schematic: SchematicWrapper): string;
|
|
6
6
|
export class BlockPosition {
|
|
7
7
|
free(): void;
|
|
8
8
|
[Symbol.dispose](): 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;
|
package/nucleation_bg.wasm
CHANGED
|
Binary file
|