746c888cd3
A .hmod may carry assets/ and data/ beside mod.wasm, or instead of it. The
manifest needs api = "0.2" and the new registries capability ("add blocks
and items to your worlds"). Content mods have no WIT interface: code still
links API 0.1.
horizon_mods::content::Content reads a mod's content and checks it:
- plain resource paths only;
- 65,536 files, 16 MiB each, 512 MiB in all;
- files in the mod's own namespace, plus additions to vanilla tags;
- blocks and items declared in data/<id>/horizon/{block,item}/*.json, each
copying a vanilla template with typed overrides (hardness, resistance,
light, tool, friction, map colour, sounds; stack size, rarity), unknown
keys refused.
Mods::load refuses an enabled mod whose content fails these checks, with
the reason on its row. A content-only mod is on with no engine and no hooks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
32 lines
1.1 KiB
TOML
32 lines
1.1 KiB
TOML
[package]
|
|
name = "horizon-mods"
|
|
version = "0.1.0"
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
rust-version = "1.86"
|
|
description = "Horizon's mod runtime: sandboxed WebAssembly components (docs/mods.md)"
|
|
|
|
[dependencies]
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
toml = "1.1.6"
|
|
zip = { version = "2", default-features = false, features = ["deflate"] }
|
|
log = "0.4"
|
|
# The 36 LTS line: security fixes until August 2027, and it builds on the client's Rust.
|
|
wasmtime = { version = "36.0.18", default-features = false, features = ["runtime", "cranelift", "component-model", "std"], optional = true }
|
|
# Turns a mod's core module into a component (cargo horizon-mod build, the tests).
|
|
wit-component = { version = "0.239", optional = true }
|
|
wit-parser = { version = "0.239", optional = true }
|
|
|
|
[features]
|
|
default = ["runtime"]
|
|
# Loads and runs mods; without it only manifests and packaging (cargo horizon-mod).
|
|
runtime = ["dep:wasmtime"]
|
|
pack = ["dep:wit-component", "dep:wit-parser"]
|
|
|
|
[dev-dependencies]
|
|
horizon-mods = { path = ".", features = ["pack"] }
|
|
|
|
[lints]
|
|
workspace = true
|