nucleation 0.1.71 → 0.1.74

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 CHANGED
@@ -1,6 +1,6 @@
1
- # 🧬 Nucleation
1
+ # Nucleation
2
2
 
3
- **Nucleation** is a high-performance Minecraft schematic engine written in Rust with full support for **Rust**, **WebAssembly/JavaScript**, **Python**, and **FFI-based integrations** like **PHP** and **C**.
3
+ **Nucleation** is a high-performance Minecraft schematic engine written in Rust with full support for **Rust**, **WebAssembly/JavaScript**, **Python**, and **FFI-based integrations** like **PHP** and **C**.
4
4
 
5
5
  > Built for performance, portability, and parity across ecosystems.
6
6
 
@@ -12,40 +12,42 @@
12
12
 
13
13
  ---
14
14
 
15
- ## Features
15
+ ## Features
16
16
 
17
- - Multi-format support: `.schematic`, `.litematic`, `.nbt`, etc.
18
- - 🧠 Memory-safe Rust core with zero-copy deserialization
19
- - 🌐 WASM module for browser + Node.js
20
- - 🐍 Native Python bindings (`pip install nucleation`)
21
- - ⚙️ C-compatible FFI for PHP, C, Go, etc.
22
- - 🔄 Feature parity across all interfaces
23
- - 📦 Binary builds for Linux, macOS, Windows (x86_64 + ARM64)
24
- - 🧱 Seamless integration with [Cubane](https://github.com/Nano112/cubane)
17
+ - Multi-format support: `.schematic`, `.litematic`, `.nbt`, etc.
18
+ - Memory-safe Rust core with zero-copy deserialization
19
+ - WASM module for browser + Node.js with simulation support
20
+ - Native Python bindings (`pip install nucleation`)
21
+ - C-compatible FFI for PHP, C, Go, etc.
22
+ - Redstone circuit simulation via MCHPRS integration (optional `simulation` feature)
23
+ - Bracket notation for setting blocks with properties: `"minecraft:lever[facing=east,powered=false]"`
24
+ - Feature parity across all interfaces
25
+ - Binary builds for Linux, macOS, Windows (x86_64 + ARM64)
26
+ - Seamless integration with [Cubane](https://github.com/Nano112/cubane)
25
27
 
26
28
  ---
27
29
 
28
- ## 📦 Installation
30
+ ## Installation
29
31
 
30
- ### 🔧 Rust
32
+ ### Rust
31
33
 
32
34
  ```bash
33
35
  cargo add nucleation
34
36
  ````
35
37
 
36
- ### 🌐 JavaScript / TypeScript (WASM)
38
+ ### JavaScript / TypeScript (WASM)
37
39
 
38
40
  ```bash
39
41
  npm install nucleation
40
42
  ```
41
43
 
42
- ### 🐍 Python
44
+ ### Python
43
45
 
44
46
  ```bash
45
47
  pip install nucleation
46
48
  ```
47
49
 
48
- ### 🧩 C / PHP / FFI
50
+ ### C / PHP / FFI
49
51
 
50
52
  Download prebuilt `.so` / `.dylib` / `.dll` from [Releases](https://github.com/Schem-at/Nucleation/releases)
51
53
  or build locally using:
@@ -56,7 +58,7 @@ or build locally using:
56
58
 
57
59
  ---
58
60
 
59
- ## 🚀 Quick Examples
61
+ ## Quick Examples
60
62
 
61
63
  ### Rust
62
64
 
@@ -69,7 +71,7 @@ schematic.load_from_data(&bytes)?;
69
71
  println!("{:?}", schematic.get_info());
70
72
  ```
71
73
 
72
- 📖 → [More in `examples/rust.md`](examples/rust.md)
74
+ [More in `examples/rust.md`](examples/rust.md)
73
75
 
74
76
  ---
75
77
 
@@ -85,7 +87,25 @@ await parser.fromData(new Uint8Array(bytes));
85
87
  console.log(parser.getDimensions());
86
88
  ```
87
89
 
88
- 📖 [More in `examples/wasm.md`](examples/wasm.md)
90
+ **Setting blocks with properties (bracket notation):**
91
+
92
+ ```js
93
+ const schematic = new SchematicWrapper();
94
+ schematic.set_block(0, 1, 0, "minecraft:lever[facing=east,powered=false,face=floor]");
95
+ schematic.set_block(5, 1, 0, "minecraft:redstone_wire[power=15,east=side,west=side]");
96
+ ```
97
+
98
+ **Redstone simulation:**
99
+
100
+ ```js
101
+ const simWorld = schematic.create_simulation_world();
102
+ simWorld.on_use_block(0, 1, 0); // Toggle lever
103
+ simWorld.tick(2);
104
+ simWorld.flush();
105
+ const isLit = simWorld.is_lit(15, 1, 0); // Check if lamp is lit
106
+ ```
107
+
108
+ [More in `examples/wasm.md`](examples/wasm.md)
89
109
 
90
110
  ---
91
111
 
@@ -103,7 +123,7 @@ schem.load_from_bytes(data)
103
123
  print(schem.get_info())
104
124
  ```
105
125
 
106
- 📖 → [More in `examples/python.md`](examples/python.md)
126
+ [More in `examples/python.md`](examples/python.md)
107
127
 
108
128
  ---
109
129
 
@@ -122,17 +142,20 @@ printf("Size: %dx%dx%d\n", info.width, info.height, info.depth);
122
142
  schematic_free(handle);
123
143
  ```
124
144
 
125
- 📖 → [More in `examples/ffi.md`](examples/ffi.md)
145
+ [More in `examples/ffi.md`](examples/ffi.md)
126
146
 
127
147
  ---
128
148
 
129
- ## 🔧 Development
149
+ ## Development
130
150
 
131
151
  ```bash
132
152
  # Build the Rust core
133
153
  cargo build --release
134
154
 
135
- # Build WASM module
155
+ # Build with simulation support
156
+ cargo build --release --features simulation
157
+
158
+ # Build WASM module (includes simulation)
136
159
  ./build-wasm.sh
137
160
 
138
161
  # Build Python bindings locally
@@ -140,11 +163,16 @@ maturin develop --features python
140
163
 
141
164
  # Build FFI libs
142
165
  ./build-ffi.sh
166
+
167
+ # Run tests
168
+ cargo test
169
+ cargo test --features simulation
170
+ ./test-wasm.sh # WASM tests with simulation
143
171
  ```
144
172
 
145
173
  ---
146
174
 
147
- ## 📚 Submodules & Bindings
175
+ ## Submodules & Bindings
148
176
 
149
177
  ### Rust
150
178
  * [`examples/rust.md`](examples/rust.md)
@@ -160,10 +188,9 @@ maturin develop --features python
160
188
 
161
189
  ---
162
190
 
163
- ## ⚖️ License
191
+ ## License
164
192
 
165
193
  Licensed under the **GNU AGPL-3.0-only**.
166
194
  See [`LICENSE`](./LICENSE) for full terms.
167
195
 
168
-
169
- Made by [@Nano112](https://github.com/Nano112) with ❤️
196
+ Made by [@Nano112](https://github.com/Nano112)