nucleation 0.2.13 → 0.2.15
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/LICENSE +21 -661
- package/README.md +26 -1
- package/nucleation-original.js +788 -53
- package/nucleation.d.ts +462 -181
- package/nucleation_bg.wasm +0 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -81,6 +81,31 @@ schem.setBlock([0, 1, 0], "minecraft:oak_sign", {
|
|
|
81
81
|
});
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
+
For lossless, fully-typed reads/writes (64-bit NBT, item components), use the
|
|
85
|
+
SNBT accessors: `getBlockEntitySnbt(x, y, z)` / `setBlockEntity(x, y, z, id, snbt)`
|
|
86
|
+
and `getEntitiesSnbt()` / `addEntityFromSnbt(snbt)`.
|
|
87
|
+
|
|
88
|
+
### Version conversion (datafixers)
|
|
89
|
+
|
|
90
|
+
Convert block / block-entity / item / entity data **between Minecraft data
|
|
91
|
+
versions** — a Rust port of PaperMC's DataConverter. Forward conversion is
|
|
92
|
+
lossless; down-converting to an older version returns a JSON **loss report** so
|
|
93
|
+
you can warn before saving. Importers capture the source data version (set it
|
|
94
|
+
manually for versionless formats; classic `.schematic` ≈ `1343`).
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
schem.fromLitematic(bytes);
|
|
98
|
+
console.log(schem.getSourceDataVersion()); // e.g. 3953 (1.21)
|
|
99
|
+
console.log(SchematicWrapper.canonicalDataVersion()); // 4790 (in-memory target)
|
|
100
|
+
|
|
101
|
+
// Save a copy for 1.16.5 (data version 2586); schem itself is untouched.
|
|
102
|
+
const { bytes: out, loss } = schem.toLitematicForVersion(2586);
|
|
103
|
+
const report = JSON.parse(loss); // [] when lossless
|
|
104
|
+
for (const e of report) { // {version, kind, severity, path, detail}
|
|
105
|
+
console.warn(`[${e.severity}] ${e.path}: ${e.detail}`);
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
84
109
|
### Storage
|
|
85
110
|
|
|
86
111
|
The `Store` class is pluggable byte storage — it decides *where bytes live*,
|
|
@@ -194,5 +219,5 @@ and meshing.
|
|
|
194
219
|
|
|
195
220
|
## License
|
|
196
221
|
|
|
197
|
-
|
|
222
|
+
MIT. See the [main repository](https://github.com/Schem-at/Nucleation)
|
|
198
223
|
for details.
|