Skip to main content

LevelsHost

Trait LevelsHost 

pub trait LevelsHost {
    // Provided methods
    fn is_loaded(&self, id: &str) -> bool { ... }
    fn chunk(&self, level: LevelRef, pos: [i32; 2]) -> Option<ChunkRef> { ... }
}
Expand description

The host’s methods both sides share of the levels area, implemented by the game and reached through Host.

Provided Methods§

fn is_loaded(&self, id: &str) -> bool

Side: both. Whether a mod with the horizon-mod.toml id id is installed: a native, wasm or content package (Fabric’s FabricLoader.isModLoaded, NeoForge’s ModList.isLoaded). The list is fixed at startup.

fn chunk(&self, level: LevelRef, pos: [i32; 2]) -> Option<ChunkRef>

Side: both. Find a loaded chunk in an open server level.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§