pub struct BlockEntityTicker {
block_entity_type: BlockEntityTypeRef,
tick: fn(&Arc<World>, BlockPos, BlockStateId, &dyn BlockEntity),
}Expand description
Erased block-state-selected ticker for one concrete block-entity type.
Vanilla obtains this callback from the owning block behavior. Keeping the expected type with the callback preserves that selection boundary while allowing Steel’s world ticker to store heterogeneous entries.
Fields§
§block_entity_type: BlockEntityTypeRef§tick: fn(&Arc<World>, BlockPos, BlockStateId, &dyn BlockEntity)Implementations§
Source§impl BlockEntityTicker
impl BlockEntityTicker
Sourcepub const fn new(
block_entity_type: BlockEntityTypeRef,
tick: fn(&Arc<World>, BlockPos, BlockStateId, &dyn BlockEntity),
) -> Self
pub const fn new( block_entity_type: BlockEntityTypeRef, tick: fn(&Arc<World>, BlockPos, BlockStateId, &dyn BlockEntity), ) -> Self
Creates a ticker for one block-entity type.
Sourcepub const fn for_entity_tick(block_entity_type: BlockEntityTypeRef) -> Self
pub const fn for_entity_tick(block_entity_type: BlockEntityTypeRef) -> Self
Creates a state-selected ticker that dispatches to BlockEntity::tick.
Sourcepub fn for_matching_entity_tick(
actual: BlockEntityTypeRef,
expected: BlockEntityTypeRef,
) -> Option<Self>
pub fn for_matching_entity_tick( actual: BlockEntityTypeRef, expected: BlockEntityTypeRef, ) -> Option<Self>
Creates the default entity callback only when Vanilla’s requested type matches.
Sourcepub fn accepts(self, block_entity_type: BlockEntityTypeRef) -> bool
pub fn accepts(self, block_entity_type: BlockEntityTypeRef) -> bool
Returns whether this ticker accepts the concrete block-entity type.
pub(crate) fn tick( self, world: &Arc<World>, pos: BlockPos, state: BlockStateId, block_entity: &dyn BlockEntity, )
fn tick_entity( world: &Arc<World>, _pos: BlockPos, _state: BlockStateId, block_entity: &dyn BlockEntity, )
Trait Implementations§
Source§impl Clone for BlockEntityTicker
impl Clone for BlockEntityTicker
Source§fn clone(&self) -> BlockEntityTicker
fn clone(&self) -> BlockEntityTicker
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BlockEntityTicker
Auto Trait Implementations§
impl !RefUnwindSafe for BlockEntityTicker
impl !UnwindSafe for BlockEntityTicker
impl Freeze for BlockEntityTicker
impl Send for BlockEntityTicker
impl Sync for BlockEntityTicker
impl Unpin for BlockEntityTicker
impl UnsafeUnpin for BlockEntityTicker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreWraps this value in an
Arc<SyncMutex<>>