Skip to main content

DrawClientHost

Trait DrawClientHost 

pub trait DrawClientHost {
    // Provided methods
    fn fluid_name(&self, fluid: &str) -> String { ... }
    fn bake_layer(&self, layer: &str) -> Option<ModelPart> { ... }
}
Expand description

The client host’s methods of the draw area, implemented by the game and reached through crate::ClientHost.

Provided Methods§

fn fluid_name(&self, fluid: &str) -> String

Side: client. Fluid fluid’s name as the lang names it (fluid_type.<mod>.<name>, vanilla’s by its block), else its path in words.

fn bake_layer(&self, layer: &str) -> Option<ModelPart>

Side: client. Entity model layer layer baked into its ModelPart tree, each part at its pose, as EntityModelSet.bakeLayer bakes it: one a native mod registered (native_register_layer_definitions), or vanilla’s, by the name entity-models.json gives it (minecraft:zombie#main, minecraft:player#main). The tree is the caller’s own copy: bake it once, as a renderer does, and set its parts’ poses each frame. None for a layer neither has. A vanilla layer no mob has (a player’s, a chest’s) is read from the resources each call, so slow. API @API:model_layers@.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§