nucleation 0.1.67 → 0.1.69
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 +172 -0
- package/nucleation.d.ts +60 -0
- package/nucleation_bg.wasm +0 -0
- package/package.json +1 -1
package/nucleation-original.js
CHANGED
|
@@ -395,6 +395,71 @@ export class BlockStateWrapper {
|
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
397
|
|
|
398
|
+
const LazyChunkIteratorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
399
|
+
? { register: () => {}, unregister: () => {} }
|
|
400
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_lazychunkiterator_free(ptr >>> 0, 1));
|
|
401
|
+
|
|
402
|
+
export class LazyChunkIterator {
|
|
403
|
+
|
|
404
|
+
static __wrap(ptr) {
|
|
405
|
+
ptr = ptr >>> 0;
|
|
406
|
+
const obj = Object.create(LazyChunkIterator.prototype);
|
|
407
|
+
obj.__wbg_ptr = ptr;
|
|
408
|
+
LazyChunkIteratorFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
409
|
+
return obj;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
__destroy_into_raw() {
|
|
413
|
+
const ptr = this.__wbg_ptr;
|
|
414
|
+
this.__wbg_ptr = 0;
|
|
415
|
+
LazyChunkIteratorFinalization.unregister(this);
|
|
416
|
+
return ptr;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
free() {
|
|
420
|
+
const ptr = this.__destroy_into_raw();
|
|
421
|
+
wasm.__wbg_lazychunkiterator_free(ptr, 0);
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Get the next chunk on-demand (generates it fresh, doesn't store it)
|
|
425
|
+
* @returns {any}
|
|
426
|
+
*/
|
|
427
|
+
next() {
|
|
428
|
+
const ret = wasm.lazychunkiterator_next(this.__wbg_ptr);
|
|
429
|
+
return ret;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* @returns {boolean}
|
|
433
|
+
*/
|
|
434
|
+
has_next() {
|
|
435
|
+
const ret = wasm.lazychunkiterator_has_next(this.__wbg_ptr);
|
|
436
|
+
return ret !== 0;
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* @returns {number}
|
|
440
|
+
*/
|
|
441
|
+
total_chunks() {
|
|
442
|
+
const ret = wasm.lazychunkiterator_total_chunks(this.__wbg_ptr);
|
|
443
|
+
return ret >>> 0;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* @returns {number}
|
|
447
|
+
*/
|
|
448
|
+
current_position() {
|
|
449
|
+
const ret = wasm.lazychunkiterator_current_position(this.__wbg_ptr);
|
|
450
|
+
return ret >>> 0;
|
|
451
|
+
}
|
|
452
|
+
reset() {
|
|
453
|
+
wasm.lazychunkiterator_reset(this.__wbg_ptr);
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* @param {number} index
|
|
457
|
+
*/
|
|
458
|
+
skip_to(index) {
|
|
459
|
+
wasm.lazychunkiterator_skip_to(this.__wbg_ptr, index);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
398
463
|
const SchematicWrapperFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
399
464
|
? { register: () => {}, unregister: () => {} }
|
|
400
465
|
: new FinalizationRegistry(ptr => wasm.__wbg_schematicwrapper_free(ptr >>> 0, 1));
|
|
@@ -514,6 +579,23 @@ export class SchematicWrapper {
|
|
|
514
579
|
const ret = wasm.schematicwrapper_get_palette_from_region(this.__wbg_ptr, ptr0, len0);
|
|
515
580
|
return ret;
|
|
516
581
|
}
|
|
582
|
+
/**
|
|
583
|
+
* @returns {any}
|
|
584
|
+
*/
|
|
585
|
+
get_bounding_box() {
|
|
586
|
+
const ret = wasm.schematicwrapper_get_bounding_box(this.__wbg_ptr);
|
|
587
|
+
return ret;
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* @param {string} region_name
|
|
591
|
+
* @returns {any}
|
|
592
|
+
*/
|
|
593
|
+
get_region_bounding_box(region_name) {
|
|
594
|
+
const ptr0 = passStringToWasm0(region_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
595
|
+
const len0 = WASM_VECTOR_LEN;
|
|
596
|
+
const ret = wasm.schematicwrapper_get_region_bounding_box(this.__wbg_ptr, ptr0, len0);
|
|
597
|
+
return ret;
|
|
598
|
+
}
|
|
517
599
|
/**
|
|
518
600
|
* @param {number} x
|
|
519
601
|
* @param {number} y
|
|
@@ -710,6 +792,92 @@ export class SchematicWrapper {
|
|
|
710
792
|
const ret = wasm.schematicwrapper_get_chunk_blocks(this.__wbg_ptr, offset_x, offset_y, offset_z, width, height, length);
|
|
711
793
|
return ret;
|
|
712
794
|
}
|
|
795
|
+
/**
|
|
796
|
+
* Get all palettes once - eliminates repeated string transfers
|
|
797
|
+
* Returns: { default: [BlockState], regions: { regionName: [BlockState] } }
|
|
798
|
+
* @returns {any}
|
|
799
|
+
*/
|
|
800
|
+
get_all_palettes() {
|
|
801
|
+
const ret = wasm.schematicwrapper_get_all_palettes(this.__wbg_ptr);
|
|
802
|
+
return ret;
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* Optimized chunks iterator that returns palette indices instead of full block data
|
|
806
|
+
* Returns array of: { chunk_x, chunk_y, chunk_z, blocks: [[x,y,z,palette_index],...] }
|
|
807
|
+
* @param {number} chunk_width
|
|
808
|
+
* @param {number} chunk_height
|
|
809
|
+
* @param {number} chunk_length
|
|
810
|
+
* @returns {Array<any>}
|
|
811
|
+
*/
|
|
812
|
+
chunks_indices(chunk_width, chunk_height, chunk_length) {
|
|
813
|
+
const ret = wasm.schematicwrapper_chunks_indices(this.__wbg_ptr, chunk_width, chunk_height, chunk_length);
|
|
814
|
+
return ret;
|
|
815
|
+
}
|
|
816
|
+
/**
|
|
817
|
+
* Optimized chunks with strategy - returns palette indices
|
|
818
|
+
* @param {number} chunk_width
|
|
819
|
+
* @param {number} chunk_height
|
|
820
|
+
* @param {number} chunk_length
|
|
821
|
+
* @param {string} strategy
|
|
822
|
+
* @param {number} camera_x
|
|
823
|
+
* @param {number} camera_y
|
|
824
|
+
* @param {number} camera_z
|
|
825
|
+
* @returns {Array<any>}
|
|
826
|
+
*/
|
|
827
|
+
chunks_indices_with_strategy(chunk_width, chunk_height, chunk_length, strategy, camera_x, camera_y, camera_z) {
|
|
828
|
+
const ptr0 = passStringToWasm0(strategy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
829
|
+
const len0 = WASM_VECTOR_LEN;
|
|
830
|
+
const ret = wasm.schematicwrapper_chunks_indices_with_strategy(this.__wbg_ptr, chunk_width, chunk_height, chunk_length, ptr0, len0, camera_x, camera_y, camera_z);
|
|
831
|
+
return ret;
|
|
832
|
+
}
|
|
833
|
+
/**
|
|
834
|
+
* Get specific chunk blocks as palette indices (for lazy loading individual chunks)
|
|
835
|
+
* Returns array of [x, y, z, palette_index]
|
|
836
|
+
* @param {number} offset_x
|
|
837
|
+
* @param {number} offset_y
|
|
838
|
+
* @param {number} offset_z
|
|
839
|
+
* @param {number} width
|
|
840
|
+
* @param {number} height
|
|
841
|
+
* @param {number} length
|
|
842
|
+
* @returns {Array<any>}
|
|
843
|
+
*/
|
|
844
|
+
get_chunk_blocks_indices(offset_x, offset_y, offset_z, width, height, length) {
|
|
845
|
+
const ret = wasm.schematicwrapper_get_chunk_blocks_indices(this.__wbg_ptr, offset_x, offset_y, offset_z, width, height, length);
|
|
846
|
+
return ret;
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* All blocks as palette indices - for when you need everything at once but efficiently
|
|
850
|
+
* Returns array of [x, y, z, palette_index]
|
|
851
|
+
* @returns {Array<any>}
|
|
852
|
+
*/
|
|
853
|
+
blocks_indices() {
|
|
854
|
+
const ret = wasm.schematicwrapper_blocks_indices(this.__wbg_ptr);
|
|
855
|
+
return ret;
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* Get optimization stats
|
|
859
|
+
* @returns {any}
|
|
860
|
+
*/
|
|
861
|
+
get_optimization_info() {
|
|
862
|
+
const ret = wasm.schematicwrapper_get_optimization_info(this.__wbg_ptr);
|
|
863
|
+
return ret;
|
|
864
|
+
}
|
|
865
|
+
/**
|
|
866
|
+
* @param {number} chunk_width
|
|
867
|
+
* @param {number} chunk_height
|
|
868
|
+
* @param {number} chunk_length
|
|
869
|
+
* @param {string} strategy
|
|
870
|
+
* @param {number} camera_x
|
|
871
|
+
* @param {number} camera_y
|
|
872
|
+
* @param {number} camera_z
|
|
873
|
+
* @returns {LazyChunkIterator}
|
|
874
|
+
*/
|
|
875
|
+
create_lazy_chunk_iterator(chunk_width, chunk_height, chunk_length, strategy, camera_x, camera_y, camera_z) {
|
|
876
|
+
const ptr0 = passStringToWasm0(strategy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
877
|
+
const len0 = WASM_VECTOR_LEN;
|
|
878
|
+
const ret = wasm.schematicwrapper_create_lazy_chunk_iterator(this.__wbg_ptr, chunk_width, chunk_height, chunk_length, ptr0, len0, camera_x, camera_y, camera_z);
|
|
879
|
+
return LazyChunkIterator.__wrap(ret);
|
|
880
|
+
}
|
|
713
881
|
}
|
|
714
882
|
|
|
715
883
|
async function __wbg_load(module, imports) {
|
|
@@ -791,6 +959,10 @@ function __wbg_get_imports() {
|
|
|
791
959
|
const ret = Date.now();
|
|
792
960
|
return ret;
|
|
793
961
|
};
|
|
962
|
+
imports.wbg.__wbg_of_4a05197bfc89556f = function(arg0, arg1, arg2) {
|
|
963
|
+
const ret = Array.of(arg0, arg1, arg2);
|
|
964
|
+
return ret;
|
|
965
|
+
};
|
|
794
966
|
imports.wbg.__wbg_push_737cfc8c1432c2c6 = function(arg0, arg1) {
|
|
795
967
|
const ret = arg0.push(arg1);
|
|
796
968
|
return ret;
|
package/nucleation.d.ts
CHANGED
|
@@ -17,6 +17,19 @@ export class BlockStateWrapper {
|
|
|
17
17
|
name(): string;
|
|
18
18
|
properties(): any;
|
|
19
19
|
}
|
|
20
|
+
export class LazyChunkIterator {
|
|
21
|
+
private constructor();
|
|
22
|
+
free(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Get the next chunk on-demand (generates it fresh, doesn't store it)
|
|
25
|
+
*/
|
|
26
|
+
next(): any;
|
|
27
|
+
has_next(): boolean;
|
|
28
|
+
total_chunks(): number;
|
|
29
|
+
current_position(): number;
|
|
30
|
+
reset(): void;
|
|
31
|
+
skip_to(index: number): void;
|
|
32
|
+
}
|
|
20
33
|
export class SchematicWrapper {
|
|
21
34
|
free(): void;
|
|
22
35
|
constructor();
|
|
@@ -29,6 +42,8 @@ export class SchematicWrapper {
|
|
|
29
42
|
get_available_schematic_versions(): Array<any>;
|
|
30
43
|
get_palette(): any;
|
|
31
44
|
get_palette_from_region(region_name: string): any;
|
|
45
|
+
get_bounding_box(): any;
|
|
46
|
+
get_region_bounding_box(region_name: string): any;
|
|
32
47
|
set_block(x: number, y: number, z: number, block_name: string): void;
|
|
33
48
|
copy_region(from_schematic: SchematicWrapper, min_x: number, min_y: number, min_z: number, max_x: number, max_y: number, max_z: number, target_x: number, target_y: number, target_z: number, excluded_blocks: any): void;
|
|
34
49
|
set_block_with_properties(x: number, y: number, z: number, block_name: string, properties: any): void;
|
|
@@ -46,6 +61,35 @@ export class SchematicWrapper {
|
|
|
46
61
|
chunks(chunk_width: number, chunk_height: number, chunk_length: number): Array<any>;
|
|
47
62
|
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>;
|
|
48
63
|
get_chunk_blocks(offset_x: number, offset_y: number, offset_z: number, width: number, height: number, length: number): Array<any>;
|
|
64
|
+
/**
|
|
65
|
+
* Get all palettes once - eliminates repeated string transfers
|
|
66
|
+
* Returns: { default: [BlockState], regions: { regionName: [BlockState] } }
|
|
67
|
+
*/
|
|
68
|
+
get_all_palettes(): any;
|
|
69
|
+
/**
|
|
70
|
+
* Optimized chunks iterator that returns palette indices instead of full block data
|
|
71
|
+
* Returns array of: { chunk_x, chunk_y, chunk_z, blocks: [[x,y,z,palette_index],...] }
|
|
72
|
+
*/
|
|
73
|
+
chunks_indices(chunk_width: number, chunk_height: number, chunk_length: number): Array<any>;
|
|
74
|
+
/**
|
|
75
|
+
* Optimized chunks with strategy - returns palette indices
|
|
76
|
+
*/
|
|
77
|
+
chunks_indices_with_strategy(chunk_width: number, chunk_height: number, chunk_length: number, strategy: string, camera_x: number, camera_y: number, camera_z: number): Array<any>;
|
|
78
|
+
/**
|
|
79
|
+
* Get specific chunk blocks as palette indices (for lazy loading individual chunks)
|
|
80
|
+
* Returns array of [x, y, z, palette_index]
|
|
81
|
+
*/
|
|
82
|
+
get_chunk_blocks_indices(offset_x: number, offset_y: number, offset_z: number, width: number, height: number, length: number): Array<any>;
|
|
83
|
+
/**
|
|
84
|
+
* All blocks as palette indices - for when you need everything at once but efficiently
|
|
85
|
+
* Returns array of [x, y, z, palette_index]
|
|
86
|
+
*/
|
|
87
|
+
blocks_indices(): Array<any>;
|
|
88
|
+
/**
|
|
89
|
+
* Get optimization stats
|
|
90
|
+
*/
|
|
91
|
+
get_optimization_info(): any;
|
|
92
|
+
create_lazy_chunk_iterator(chunk_width: number, chunk_height: number, chunk_length: number, strategy: string, camera_x: number, camera_y: number, camera_z: number): LazyChunkIterator;
|
|
49
93
|
}
|
|
50
94
|
|
|
51
95
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
@@ -60,6 +104,7 @@ export interface InitOutput {
|
|
|
60
104
|
readonly __wbg_get_blockposition_z: (a: number) => number;
|
|
61
105
|
readonly __wbg_set_blockposition_z: (a: number, b: number) => void;
|
|
62
106
|
readonly blockposition_new: (a: number, b: number, c: number) => number;
|
|
107
|
+
readonly __wbg_lazychunkiterator_free: (a: number, b: number) => void;
|
|
63
108
|
readonly __wbg_schematicwrapper_free: (a: number, b: number) => void;
|
|
64
109
|
readonly __wbg_blockstatewrapper_free: (a: number, b: number) => void;
|
|
65
110
|
readonly schematicwrapper_new: () => number;
|
|
@@ -72,6 +117,8 @@ export interface InitOutput {
|
|
|
72
117
|
readonly schematicwrapper_get_available_schematic_versions: (a: number) => any;
|
|
73
118
|
readonly schematicwrapper_get_palette: (a: number) => any;
|
|
74
119
|
readonly schematicwrapper_get_palette_from_region: (a: number, b: number, c: number) => any;
|
|
120
|
+
readonly schematicwrapper_get_bounding_box: (a: number) => any;
|
|
121
|
+
readonly schematicwrapper_get_region_bounding_box: (a: number, b: number, c: number) => any;
|
|
75
122
|
readonly schematicwrapper_set_block: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
76
123
|
readonly schematicwrapper_copy_region: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: any) => [number, number];
|
|
77
124
|
readonly schematicwrapper_set_block_with_properties: (a: number, b: number, c: number, d: number, e: number, f: number, g: any) => [number, number];
|
|
@@ -89,6 +136,19 @@ export interface InitOutput {
|
|
|
89
136
|
readonly schematicwrapper_chunks: (a: number, b: number, c: number, d: number) => any;
|
|
90
137
|
readonly schematicwrapper_chunks_with_strategy: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => any;
|
|
91
138
|
readonly schematicwrapper_get_chunk_blocks: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => any;
|
|
139
|
+
readonly schematicwrapper_get_all_palettes: (a: number) => any;
|
|
140
|
+
readonly schematicwrapper_chunks_indices: (a: number, b: number, c: number, d: number) => any;
|
|
141
|
+
readonly schematicwrapper_chunks_indices_with_strategy: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => any;
|
|
142
|
+
readonly schematicwrapper_get_chunk_blocks_indices: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => any;
|
|
143
|
+
readonly schematicwrapper_blocks_indices: (a: number) => any;
|
|
144
|
+
readonly schematicwrapper_get_optimization_info: (a: number) => any;
|
|
145
|
+
readonly schematicwrapper_create_lazy_chunk_iterator: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
|
|
146
|
+
readonly lazychunkiterator_next: (a: number) => any;
|
|
147
|
+
readonly lazychunkiterator_has_next: (a: number) => number;
|
|
148
|
+
readonly lazychunkiterator_total_chunks: (a: number) => number;
|
|
149
|
+
readonly lazychunkiterator_current_position: (a: number) => number;
|
|
150
|
+
readonly lazychunkiterator_reset: (a: number) => void;
|
|
151
|
+
readonly lazychunkiterator_skip_to: (a: number, b: number) => void;
|
|
92
152
|
readonly blockstatewrapper_new: (a: number, b: number) => number;
|
|
93
153
|
readonly blockstatewrapper_with_property: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
94
154
|
readonly blockstatewrapper_name: (a: number) => [number, number];
|
package/nucleation_bg.wasm
CHANGED
|
Binary file
|