Skip to main content

Tags

Trait Tags 

pub trait Tags {
    // Provided methods
    fn key(&self, _id: &Identifier) -> Option<TagKey> { ... }
    fn is_in_tag(&self, _item: ItemKey, _tag: TagKey) -> Option<bool> { ... }
    fn items(&self, _tag: TagKey) -> Option<Vec<ItemKey>> { ... }
    fn fluids(&self, _tag: TagKey) -> Option<Vec<FluidKey>> { ... }
    fn blocks(&self, _tag: TagKey) -> Option<Vec<BlockKey>> { ... }
}
Expand description

Read merged block, item and fluid tags without borrowing the game’s registry structs. Unknown tags answer false or an empty member list. A client reads the tags its server sent. Membership reads answer None before authoritative tags are loaded, on a client before its server’s are applied, or while their key table is unavailable.

Provided Methods§

fn key(&self, _id: &Identifier) -> Option<TagKey>

Resolve a validated name once. The name need not currently have members; retain its key across reloads. None if the runtime cannot allocate a name slot.

fn is_in_tag(&self, _item: ItemKey, _tag: TagKey) -> Option<bool>

Whether item is in the current item tag. An unknown tag is false; unavailable authoritative tags or item mappings answer None.

fn items(&self, _tag: TagKey) -> Option<Vec<ItemKey>>

Item members in vanilla’s order, including unrequested vanilla items. Unknown tags are empty; unavailable authoritative tags or item mappings answer None.

fn fluids(&self, _tag: TagKey) -> Option<Vec<FluidKey>>

Fluid members in vanilla’s order. Unknown tags are empty; unavailable authoritative tags or fluid mappings answer None.

fn blocks(&self, _tag: TagKey) -> Option<Vec<BlockKey>>

Block members in vanilla’s order, including unrequested vanilla blocks. Unknown tags are empty; unavailable authoritative tags or block mappings answer None.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§