Trait GameRulesRegistrar
pub trait GameRulesRegistrar {
// Required methods
fn game_rule_category(&mut self, id: &str) -> Result<(), GameRuleError>;
fn game_rule_bool(
&mut self,
id: &str,
category: &str,
default: bool,
) -> Result<BoolGameRuleKey, GameRuleError>;
}Expand description
Registrar operations for game rules.
Required Methods§
fn game_rule_category(&mut self, id: &str) -> Result<(), GameRuleError>
fn game_rule_category(&mut self, id: &str) -> Result<(), GameRuleError>
Declare a game rule category in a namespace owned by the calling mod’s manifest. Invalid, foreign or duplicate IDs refuse mod loading even if the error is ignored. Categories appear in the host’s game rules screen; remote clients do not receive them in this version.
fn game_rule_bool(
&mut self,
id: &str,
category: &str,
default: bool,
) -> Result<BoolGameRuleKey, GameRuleError>
fn game_rule_bool( &mut self, id: &str, category: &str, default: bool, ) -> Result<BoolGameRuleKey, GameRuleError>
Declare a boolean game rule in a namespace owned by this mod’s manifest. Category references are resolved after all mods register; an unknown category refuses installation then.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".