nucleation 0.1.80 → 0.1.82
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/README.md +19 -0
- package/nucleation-original.js +36 -0
- package/nucleation.d.ts +20 -0
- package/nucleation_bg.wasm +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -105,6 +105,25 @@ simWorld.flush();
|
|
|
105
105
|
const isLit = simWorld.is_lit(15, 1, 0); // Check if lamp is lit
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
+
**Custom IO signal injection/monitoring:**
|
|
109
|
+
|
|
110
|
+
```js
|
|
111
|
+
// Configure custom IO nodes for precise signal control
|
|
112
|
+
const options = new SimulationOptions();
|
|
113
|
+
options.addCustomIo(5, 1, 0); // Mark position as custom IO node
|
|
114
|
+
|
|
115
|
+
const simWorld = schematic.create_simulation_world_with_options(options);
|
|
116
|
+
|
|
117
|
+
// Inject custom signal strength
|
|
118
|
+
simWorld.setSignalStrength(5, 1, 0, 12); // Set signal to 12
|
|
119
|
+
simWorld.tick(5);
|
|
120
|
+
simWorld.flush();
|
|
121
|
+
|
|
122
|
+
// Read signal strength
|
|
123
|
+
const strength = simWorld.getSignalStrength(5, 1, 0);
|
|
124
|
+
console.log(`Signal strength: ${strength}`);
|
|
125
|
+
```
|
|
126
|
+
|
|
108
127
|
[More in `examples/wasm.md`](examples/wasm.md)
|
|
109
128
|
|
|
110
129
|
---
|
package/nucleation-original.js
CHANGED
|
@@ -583,6 +583,27 @@ export class MchprsWorldWrapper {
|
|
|
583
583
|
const ret = wasm.mchprsworldwrapper_get_redstone_power(this.__wbg_ptr, x, y, z);
|
|
584
584
|
return ret;
|
|
585
585
|
}
|
|
586
|
+
/**
|
|
587
|
+
* Gets the signal strength at a specific block position (for custom IO nodes)
|
|
588
|
+
* @param {number} x
|
|
589
|
+
* @param {number} y
|
|
590
|
+
* @param {number} z
|
|
591
|
+
* @returns {number}
|
|
592
|
+
*/
|
|
593
|
+
getSignalStrength(x, y, z) {
|
|
594
|
+
const ret = wasm.mchprsworldwrapper_getSignalStrength(this.__wbg_ptr, x, y, z);
|
|
595
|
+
return ret;
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* Sets the signal strength at a specific block position (for custom IO nodes)
|
|
599
|
+
* @param {number} x
|
|
600
|
+
* @param {number} y
|
|
601
|
+
* @param {number} z
|
|
602
|
+
* @param {number} strength
|
|
603
|
+
*/
|
|
604
|
+
setSignalStrength(x, y, z, strength) {
|
|
605
|
+
wasm.mchprsworldwrapper_setSignalStrength(this.__wbg_ptr, x, y, z, strength);
|
|
606
|
+
}
|
|
586
607
|
/**
|
|
587
608
|
* @param {SchematicWrapper} schematic
|
|
588
609
|
*/
|
|
@@ -1249,6 +1270,21 @@ export class SimulationOptionsWrapper {
|
|
|
1249
1270
|
set optimize(value) {
|
|
1250
1271
|
wasm.simulationoptionswrapper_set_optimize(this.__wbg_ptr, value);
|
|
1251
1272
|
}
|
|
1273
|
+
/**
|
|
1274
|
+
* Adds a position to the custom IO list
|
|
1275
|
+
* @param {number} x
|
|
1276
|
+
* @param {number} y
|
|
1277
|
+
* @param {number} z
|
|
1278
|
+
*/
|
|
1279
|
+
addCustomIo(x, y, z) {
|
|
1280
|
+
wasm.simulationoptionswrapper_addCustomIo(this.__wbg_ptr, x, y, z);
|
|
1281
|
+
}
|
|
1282
|
+
/**
|
|
1283
|
+
* Clears the custom IO list
|
|
1284
|
+
*/
|
|
1285
|
+
clearCustomIo() {
|
|
1286
|
+
wasm.simulationoptionswrapper_clearCustomIo(this.__wbg_ptr);
|
|
1287
|
+
}
|
|
1252
1288
|
constructor() {
|
|
1253
1289
|
const ret = wasm.simulationoptionswrapper_new();
|
|
1254
1290
|
this.__wbg_ptr = ret >>> 0;
|
package/nucleation.d.ts
CHANGED
|
@@ -76,6 +76,14 @@ export class MchprsWorldWrapper {
|
|
|
76
76
|
* Gets the redstone power level at a position
|
|
77
77
|
*/
|
|
78
78
|
get_redstone_power(x: number, y: number, z: number): number;
|
|
79
|
+
/**
|
|
80
|
+
* Gets the signal strength at a specific block position (for custom IO nodes)
|
|
81
|
+
*/
|
|
82
|
+
getSignalStrength(x: number, y: number, z: number): number;
|
|
83
|
+
/**
|
|
84
|
+
* Sets the signal strength at a specific block position (for custom IO nodes)
|
|
85
|
+
*/
|
|
86
|
+
setSignalStrength(x: number, y: number, z: number, strength: number): void;
|
|
79
87
|
constructor(schematic: SchematicWrapper);
|
|
80
88
|
/**
|
|
81
89
|
* Advances the simulation by the specified number of ticks
|
|
@@ -223,6 +231,14 @@ export class SchematicWrapper {
|
|
|
223
231
|
export class SimulationOptionsWrapper {
|
|
224
232
|
free(): void;
|
|
225
233
|
[Symbol.dispose](): void;
|
|
234
|
+
/**
|
|
235
|
+
* Adds a position to the custom IO list
|
|
236
|
+
*/
|
|
237
|
+
addCustomIo(x: number, y: number, z: number): void;
|
|
238
|
+
/**
|
|
239
|
+
* Clears the custom IO list
|
|
240
|
+
*/
|
|
241
|
+
clearCustomIo(): void;
|
|
226
242
|
constructor();
|
|
227
243
|
io_only: boolean;
|
|
228
244
|
optimize: boolean;
|
|
@@ -258,6 +274,7 @@ export interface InitOutput {
|
|
|
258
274
|
readonly lazychunkiterator_skip_to: (a: number, b: number) => void;
|
|
259
275
|
readonly lazychunkiterator_total_chunks: (a: number) => number;
|
|
260
276
|
readonly mchprsworldwrapper_flush: (a: number) => void;
|
|
277
|
+
readonly mchprsworldwrapper_getSignalStrength: (a: number, b: number, c: number, d: number) => number;
|
|
261
278
|
readonly mchprsworldwrapper_get_lever_power: (a: number, b: number, c: number, d: number) => number;
|
|
262
279
|
readonly mchprsworldwrapper_get_redstone_power: (a: number, b: number, c: number, d: number) => number;
|
|
263
280
|
readonly mchprsworldwrapper_get_schematic: (a: number) => number;
|
|
@@ -266,6 +283,7 @@ export interface InitOutput {
|
|
|
266
283
|
readonly mchprsworldwrapper_is_lit: (a: number, b: number, c: number, d: number) => number;
|
|
267
284
|
readonly mchprsworldwrapper_new: (a: number) => [number, number, number];
|
|
268
285
|
readonly mchprsworldwrapper_on_use_block: (a: number, b: number, c: number, d: number) => void;
|
|
286
|
+
readonly mchprsworldwrapper_setSignalStrength: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
269
287
|
readonly mchprsworldwrapper_sync_to_schematic: (a: number) => void;
|
|
270
288
|
readonly mchprsworldwrapper_tick: (a: number, b: number) => void;
|
|
271
289
|
readonly mchprsworldwrapper_with_options: (a: number, b: number) => [number, number, number];
|
|
@@ -319,6 +337,8 @@ export interface InitOutput {
|
|
|
319
337
|
readonly schematicwrapper_to_litematic: (a: number) => [number, number, number, number];
|
|
320
338
|
readonly schematicwrapper_to_schematic: (a: number) => [number, number, number, number];
|
|
321
339
|
readonly schematicwrapper_to_schematic_version: (a: number, b: number, c: number) => [number, number, number, number];
|
|
340
|
+
readonly simulationoptionswrapper_addCustomIo: (a: number, b: number, c: number, d: number) => void;
|
|
341
|
+
readonly simulationoptionswrapper_clearCustomIo: (a: number) => void;
|
|
322
342
|
readonly simulationoptionswrapper_io_only: (a: number) => number;
|
|
323
343
|
readonly simulationoptionswrapper_new: () => number;
|
|
324
344
|
readonly simulationoptionswrapper_optimize: (a: number) => number;
|
package/nucleation_bg.wasm
CHANGED
|
Binary file
|