Skip to main content

SignApplicator

Trait SignApplicator 

Source
pub trait SignApplicator: Send + Sync {
    // Required method
    fn try_apply_to_sign(
        &self,
        world: &World,
        sign: &SignBlockEntity,
        slot: SignTextSlot,
        item: &ItemStack,
        player: &Player,
    ) -> bool;

    // Provided method
    fn can_apply_to_sign(
        &self,
        text: &SignText,
        _item: &ItemStack,
        _player: &Player,
    ) -> bool { ... }
}
Expand description

Item capability applied by a sign before its editor fallback.

Required Methods§

Source

fn try_apply_to_sign( &self, world: &World, sign: &SignBlockEntity, slot: SignTextSlot, item: &ItemStack, player: &Player, ) -> bool

Applies the change; the sign handles consumption, statistics and updates.

Provided Methods§

Source

fn can_apply_to_sign( &self, text: &SignText, _item: &ItemStack, _player: &Player, ) -> bool

Returns whether this item can change the selected sign text.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§