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>
17 lines
641 B
Rust
17 lines
641 B
Rust
//! Horizon's mods (`docs/mods.md`): WebAssembly components written against
|
|
//! `crates/horizon-mod-sdk/wit/horizon.wit`, each in its own sandbox with
|
|
//! no file, network or clock access, a memory cap and a time budget per
|
|
//! call. A mod that traps or overruns is turned off; the game goes on.
|
|
//!
|
|
//! Nothing here runs unless a mod is installed and turned on: an empty
|
|
//! [`Mods`] makes no engine and every hook returns at once.
|
|
pub mod content;
|
|
pub mod manifest;
|
|
#[cfg(feature = "runtime")]
|
|
mod runtime;
|
|
|
|
pub use content::Content;
|
|
pub use manifest::{Capability, Manifest, Package, Side};
|
|
#[cfg(feature = "runtime")]
|
|
pub use runtime::*;
|