nucleation 0.1.72 → 0.1.75
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 +57 -27
- package/nucleation-original.js +539 -365
- package/nucleation.d.ts +168 -92
- package/nucleation_bg.wasm +0 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Nucleation
|
|
2
2
|
|
|
3
|
-
**Nucleation** is a high-performance Minecraft schematic engine written in Rust
|
|
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
|
-
##
|
|
15
|
+
## Features
|
|
16
16
|
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
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
|
-
##
|
|
30
|
+
## Installation
|
|
29
31
|
|
|
30
|
-
###
|
|
32
|
+
### Rust
|
|
31
33
|
|
|
32
34
|
```bash
|
|
33
35
|
cargo add nucleation
|
|
34
36
|
````
|
|
35
37
|
|
|
36
|
-
###
|
|
38
|
+
### JavaScript / TypeScript (WASM)
|
|
37
39
|
|
|
38
40
|
```bash
|
|
39
41
|
npm install nucleation
|
|
40
42
|
```
|
|
41
43
|
|
|
42
|
-
###
|
|
44
|
+
### Python
|
|
43
45
|
|
|
44
46
|
```bash
|
|
45
47
|
pip install nucleation
|
|
46
48
|
```
|
|
47
49
|
|
|
48
|
-
###
|
|
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
|
-
##
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
145
|
+
[More in `examples/ffi.md`](examples/ffi.md)
|
|
126
146
|
|
|
127
147
|
---
|
|
128
148
|
|
|
129
|
-
##
|
|
149
|
+
## Development
|
|
130
150
|
|
|
131
151
|
```bash
|
|
132
152
|
# Build the Rust core
|
|
133
153
|
cargo build --release
|
|
134
154
|
|
|
135
|
-
# Build
|
|
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,19 @@ 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
|
|
171
|
+
|
|
172
|
+
# Pre-push verification (recommended before pushing)
|
|
173
|
+
./pre-push.sh # Runs all checks that CI runs
|
|
143
174
|
```
|
|
144
175
|
|
|
145
176
|
---
|
|
146
177
|
|
|
147
|
-
##
|
|
178
|
+
## Submodules & Bindings
|
|
148
179
|
|
|
149
180
|
### Rust
|
|
150
181
|
* [`examples/rust.md`](examples/rust.md)
|
|
@@ -160,10 +191,9 @@ maturin develop --features python
|
|
|
160
191
|
|
|
161
192
|
---
|
|
162
193
|
|
|
163
|
-
##
|
|
194
|
+
## License
|
|
164
195
|
|
|
165
196
|
Licensed under the **GNU AGPL-3.0-only**.
|
|
166
197
|
See [`LICENSE`](./LICENSE) for full terms.
|
|
167
198
|
|
|
168
|
-
|
|
169
|
-
Made by [@Nano112](https://github.com/Nano112) with ❤️
|
|
199
|
+
Made by [@Nano112](https://github.com/Nano112)
|