๐งฌ Nucleation
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.
Built for performance, portability, and parity across ecosystems.
โจ Features
- โ
Multi-format support:
.schematic,.litematic,.nbt, etc. - ๐ง Memory-safe Rust core with zero-copy deserialization
- ๐ WASM module for browser + Node.js with TypeScript support
- ๐ Native Python bindings (
pip install nucleation) - โ๏ธ C-compatible FFI for PHP, C, Go, etc.
- ๐จ Blockpedia integration for color analysis and block transformations (native targets)
- ๐ Feature parity across all interfaces via single API definition
- ๐ฆ Binary builds for Linux, macOS, Windows (x86_64 + ARM64)
- ๐ Automatic binding generation from centralized API definitions
- ๐งช Comprehensive test suite with CI/CD pipeline
๐ฆ Installation
๐ง Rust
๐ JavaScript / TypeScript (WASM)
๐ Python
๐งฉ C / PHP / FFI
Download prebuilt .so / .dylib / .dll from Releases
or build locally using:
๐ Quick Examples
Rust
use UniversalSchematic;
let bytes = read?;
let mut schematic = new;
schematic.load_from_data?;
println!;
๐ โ Documentation | Complete Code Example
JavaScript (WASM)
import { SchematicParser } from "nucleation";
const bytes = await fetch("example.litematic").then(r => r.arrayBuffer());
const parser = new SchematicParser();
await parser.fromData(new Uint8Array(bytes));
console.log(parser.getDimensions());
๐ โ Documentation | Complete Code Example
Python
=
=
๐ โ Documentation | Complete Code Example
FFI (PHP/C)
SchematicHandle* handle = ;
;
CSchematicInfo info;
;
;
;
๐ โ Documentation | Complete Code Example
๐ง Development
Building
# Build the Rust core
# Build WASM module with target support
# Build Python bindings locally
# Build FFI libs
๐ค Automated Binding Generation
Nucleation uses a single source of truth approach for all bindings. The API is defined once in src/api_definition.rs and automatically translated to all supported languages:
# Generate all binding files from API definition
# Check if bindings are up to date
# Generate API documentation report
This generates:
- WASM: TypeScript definitions and JavaScript bindings
- Python: PyO3 bindings and
.pyitype stubs - FFI: C header files and Rust FFI implementations
๐งช Testing
# Run all tests
# Test specific targets
# Test WASM build specifically
Note: WASM builds exclude blockpedia features for compatibility. Color analysis and block transformations are available only on native targets.
Version Management
Versions are centrally managed in version.toml. Use the Makefile commands:
# Check version consistency across all files
# Bump versions automatically
# Update all files from version.toml
๐ โ Full Version Management Guide
๐ Submodules & Bindings
๐ Documentation & Examples
Each binding includes comprehensive documentation and working code examples:
| Language | API Documentation | Working Example | Type Definitions |
|---|---|---|---|
| Rust | examples/rust.md |
examples/rust_example.rs |
Native Rust docs |
| JavaScript/WASM | examples/wasm.md |
examples/wasm_example.js |
pkg/nucleation.d.ts |
| Python | examples/python.md |
examples/python_example.py |
python-stubs/nucleation.pyi |
| C/FFI | examples/ffi.md |
examples/ffi_example.c |
include/nucleation.h |
โ๏ธ License
Licensed under the GNU AGPL-3.0-only.
See LICENSE for full terms.
Made by @Nano112 with โค๏ธ