Skip to main content

Context

Trait Context 

Source
pub trait Context:
    PlayerContext
    + ChatContext
    + WorldContext
    + EntityContext
    + ContainerContext
    + RecipeContext {
    // Required methods
    fn logger(&self) -> PluginLogger;
    fn player(&self) -> &dyn PlayerContext;
    fn chat(&self) -> &dyn ChatContext;
    fn world_ctx(&self) -> &dyn WorldContext;
    fn entities(&self) -> &dyn EntityContext;
    fn containers(&self) -> &dyn ContainerContext;
    fn recipes(&self) -> &dyn RecipeContext;
}
Expand description

Execution context for commands and event handlers.

Provides sub-context accessors for domain-specific operations. Implemented by ServerContext (in basalt-server) and potentially ConsoleContext (server terminal) in the future.

Required Methods§

Source

fn logger(&self) -> PluginLogger

Returns a logger scoped to the current plugin.

Source

fn player(&self) -> &dyn PlayerContext

Access player identity and state.

Source

fn chat(&self) -> &dyn ChatContext

Access chat and messaging.

Source

fn world_ctx(&self) -> &dyn WorldContext

Access world, blocks, chunks, and persistence.

Source

fn entities(&self) -> &dyn EntityContext

Access entity management.

Source

fn containers(&self) -> &dyn ContainerContext

Access container interaction.

Source

fn recipes(&self) -> &dyn RecipeContext

Access the current player’s recipe-book state.

Implementors§