nucleation 0.10.9 → 0.10.12

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.
@@ -33,7 +33,7 @@ export class AnimationEffect {
33
33
  * `x`, `y`, `z`, `rotateX`, `rotateY`, `rotateZ`, `scale`, `opacity`,
34
34
  * `tintR/G/B/A`, and `emissiveR/G/B`.
35
35
  */
36
- addTween(propertyName: string, from: number, to: number, easingName: string): void;
36
+ addTween(propertyName: string, start: number, end: number, easingName: string): void;
37
37
 
38
38
  /**
39
39
  * Add a normalised keyframe (`at` in `0..=1`) to a property track.
@@ -33,7 +33,7 @@ export class AnimationEffect {
33
33
  * `x`, `y`, `z`, `rotateX`, `rotateY`, `rotateZ`, `scale`, `opacity`,
34
34
  * `tintR/G/B/A`, and `emissiveR/G/B`.
35
35
  */
36
- addTween(propertyName: string, from: number, to: number, easingName: string): void;
36
+ addTween(propertyName: string, start: number, end: number, easingName: string): void;
37
37
 
38
38
  /**
39
39
  * Add a normalised keyframe (`at` in `0..=1`) to a property track.
@@ -135,7 +135,7 @@ export class AnimationEffect {
135
135
  * `x`, `y`, `z`, `rotateX`, `rotateY`, `rotateZ`, `scale`, `opacity`,
136
136
  * `tintR/G/B/A`, and `emissiveR/G/B`.
137
137
  */
138
- addTween(propertyName, from, to, easingName) {
138
+ addTween(propertyName, start, end, easingName) {
139
139
  let functionCleanupArena = new diplomatRuntime.CleanupArena();
140
140
 
141
141
  const propertyNameSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, propertyName)));
@@ -143,7 +143,7 @@ export class AnimationEffect {
143
143
  const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
144
144
 
145
145
 
146
- const result = wasm.AnimationEffect_add_tween(diplomatReceive.buffer, this.ffiValue, propertyNameSlice.ptr, from, to, easingNameSlice.ptr);
146
+ const result = wasm.AnimationEffect_add_tween(diplomatReceive.buffer, this.ffiValue, propertyNameSlice.ptr, start, end, easingNameSlice.ptr);
147
147
 
148
148
  try {
149
149
  if (!diplomatReceive.resultFlag) {
package/Schematic.d.mts CHANGED
@@ -181,6 +181,32 @@ export class Schematic {
181
181
  */
182
182
  setBlocks(positions: Array<number>, blockName: string): number;
183
183
 
184
+ /**
185
+ * Sequentially hand-place the same block at many positions in one
186
+ * local simulated component. `positions` is flat
187
+ * `[x0,y0,z0, x1,y1,z1, ...]`; placements run in that order and each
188
+ * settles before the next. Returns the number of final cells written
189
+ * back, including neighbours changed by redstone or pistons.
190
+ *
191
+ * Nearby passive blocks are loaded as environmental context, but the
192
+ * write-back is confined to the active component's effect window. Its
193
+ * runtime is therefore independent of unrelated schematic volume.
194
+ * Use `set_blocks_simulated_full_world` to opt into global updates.
195
+ *
196
+ * This is the efficient bulk form of repeated `{simulate=true}`:
197
+ * structure conversion and simulator wiring happen once for the
198
+ * complete sequence. Propagation is not constant-time—a placement can
199
+ * affect an arbitrarily large circuit—but fixed setup is amortized.
200
+ */
201
+ setBlocksSimulated(positions: Array<number>, blockName: string): number;
202
+
203
+ /**
204
+ * Explicit full-world counterpart to `set_blocks_simulated`.
205
+ * Unrelated schematic volume participates in setup and any resulting
206
+ * changes anywhere in the loaded world are written back.
207
+ */
208
+ setBlocksSimulatedFullWorld(positions: Array<number>, blockName: string): number;
209
+
184
210
  /**
185
211
  * Batch-get block names at multiple positions. `positions` is flat
186
212
  * `[x0,y0,z0, ...]` (length must be a multiple of 3). Writes a JSON array,
package/Schematic.d.ts CHANGED
@@ -181,6 +181,32 @@ export class Schematic {
181
181
  */
182
182
  setBlocks(positions: Array<number>, blockName: string): number;
183
183
 
184
+ /**
185
+ * Sequentially hand-place the same block at many positions in one
186
+ * local simulated component. `positions` is flat
187
+ * `[x0,y0,z0, x1,y1,z1, ...]`; placements run in that order and each
188
+ * settles before the next. Returns the number of final cells written
189
+ * back, including neighbours changed by redstone or pistons.
190
+ *
191
+ * Nearby passive blocks are loaded as environmental context, but the
192
+ * write-back is confined to the active component's effect window. Its
193
+ * runtime is therefore independent of unrelated schematic volume.
194
+ * Use `set_blocks_simulated_full_world` to opt into global updates.
195
+ *
196
+ * This is the efficient bulk form of repeated `{simulate=true}`:
197
+ * structure conversion and simulator wiring happen once for the
198
+ * complete sequence. Propagation is not constant-time—a placement can
199
+ * affect an arbitrarily large circuit—but fixed setup is amortized.
200
+ */
201
+ setBlocksSimulated(positions: Array<number>, blockName: string): number;
202
+
203
+ /**
204
+ * Explicit full-world counterpart to `set_blocks_simulated`.
205
+ * Unrelated schematic volume participates in setup and any resulting
206
+ * changes anywhere in the loaded world are written back.
207
+ */
208
+ setBlocksSimulatedFullWorld(positions: Array<number>, blockName: string): number;
209
+
184
210
  /**
185
211
  * Batch-get block names at multiple positions. `positions` is flat
186
212
  * `[x0,y0,z0, ...]` (length must be a multiple of 3). Writes a JSON array,
package/Schematic.mjs CHANGED
@@ -823,6 +823,80 @@ export class Schematic {
823
823
  }
824
824
  }
825
825
 
826
+ /**
827
+ * Sequentially hand-place the same block at many positions in one
828
+ * local simulated component. `positions` is flat
829
+ * `[x0,y0,z0, x1,y1,z1, ...]`; placements run in that order and each
830
+ * settles before the next. Returns the number of final cells written
831
+ * back, including neighbours changed by redstone or pistons.
832
+ *
833
+ * Nearby passive blocks are loaded as environmental context, but the
834
+ * write-back is confined to the active component's effect window. Its
835
+ * runtime is therefore independent of unrelated schematic volume.
836
+ * Use `set_blocks_simulated_full_world` to opt into global updates.
837
+ *
838
+ * This is the efficient bulk form of repeated `{simulate=true}`:
839
+ * structure conversion and simulator wiring happen once for the
840
+ * complete sequence. Propagation is not constant-time—a placement can
841
+ * affect an arbitrarily large circuit—but fixed setup is amortized.
842
+ */
843
+ setBlocksSimulated(positions, blockName) {
844
+ let functionCleanupArena = new diplomatRuntime.CleanupArena();
845
+
846
+ const positionsSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.slice(wasm, positions, "i32")));
847
+ const blockNameSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, blockName)));
848
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
849
+
850
+
851
+ const result = wasm.Schematic_set_blocks_simulated(diplomatReceive.buffer, this.ffiValue, positionsSlice.ptr, blockNameSlice.ptr);
852
+
853
+ try {
854
+ if (!diplomatReceive.resultFlag) {
855
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
856
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
857
+ }
858
+ return (new Int32Array(wasm.memory.buffer, diplomatReceive.buffer, 1))[0];
859
+ }
860
+
861
+ finally {
862
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
863
+ functionCleanupArena.free();
864
+
865
+ diplomatReceive.free();
866
+ }
867
+ }
868
+
869
+ /**
870
+ * Explicit full-world counterpart to `set_blocks_simulated`.
871
+ * Unrelated schematic volume participates in setup and any resulting
872
+ * changes anywhere in the loaded world are written back.
873
+ */
874
+ setBlocksSimulatedFullWorld(positions, blockName) {
875
+ let functionCleanupArena = new diplomatRuntime.CleanupArena();
876
+
877
+ const positionsSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.slice(wasm, positions, "i32")));
878
+ const blockNameSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, blockName)));
879
+ const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
880
+
881
+
882
+ const result = wasm.Schematic_set_blocks_simulated_full_world(diplomatReceive.buffer, this.ffiValue, positionsSlice.ptr, blockNameSlice.ptr);
883
+
884
+ try {
885
+ if (!diplomatReceive.resultFlag) {
886
+ const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
887
+ throw new globalThis.Error('NucleationError.' + cause.value, { cause });
888
+ }
889
+ return (new Int32Array(wasm.memory.buffer, diplomatReceive.buffer, 1))[0];
890
+ }
891
+
892
+ finally {
893
+ diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
894
+ functionCleanupArena.free();
895
+
896
+ diplomatReceive.free();
897
+ }
898
+ }
899
+
826
900
  /**
827
901
  * Batch-get block names at multiple positions. `positions` is flat
828
902
  * `[x0,y0,z0, ...]` (length must be a multiple of 3). Writes a JSON array,
package/nucleation.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nucleation",
3
- "version": "0.10.9",
3
+ "version": "0.10.12",
4
4
  "description": "A high-performance Minecraft schematic parser and utility library",
5
5
  "type": "module",
6
6
  "main": "index.mjs",