pub(crate) struct WorldBlockEntityTickers {
state: SyncMutex<TickerState>,
}Expand description
Vanilla-shaped world-global active and pending block-entity ticker lists.
Fields§
§state: SyncMutex<TickerState>Implementations§
Source§impl WorldBlockEntityTickers
impl WorldBlockEntityTickers
pub(crate) fn new() -> Self
Sourcepub(crate) fn reconcile(
&self,
holder: &Arc<ChunkHolder>,
entity: SharedBlockEntity,
ticker: Option<BlockEntityTicker>,
)
pub(crate) fn reconcile( &self, holder: &Arc<ChunkHolder>, entity: SharedBlockEntity, ticker: Option<BlockEntityTicker>, )
Reconciles one live storage owner with its state-selected ticker.
Rebinding an existing position preserves its global registration slot. Disabling then enabling creates a new tail, matching Vanilla.
Sourcepub(crate) fn remove(&self, holder: &Arc<ChunkHolder>, pos: BlockPos)
pub(crate) fn remove(&self, holder: &Arc<ChunkHolder>, pos: BlockPos)
Removes the wrapper only when it still belongs to holder.
Sourcepub(crate) fn remove_positions(
&self,
holder: &Arc<ChunkHolder>,
positions: &[BlockPos],
)
pub(crate) fn remove_positions( &self, holder: &Arc<ChunkHolder>, positions: &[BlockPos], )
Unbinds tickers at concrete positions owned by one finalized chunk holder.
Sourcepub(crate) fn tick(&self, world: &Arc<World>, runs_normally: bool)
pub(crate) fn tick(&self, world: &Arc<World>, runs_normally: bool)
Runs one global ticker phase while keeping registration locks out of callbacks.
fn tick_phase( &self, runs_normally: bool, tick_binding: impl FnMut(&Arc<BoundBlockEntityTicker>), )
fn tick_binding( world: &Arc<World>, border: WorldBorderSnapshot, binding: &Arc<BoundBlockEntityTicker>, )
fn remove_if_same( &self, wrapper: &Arc<RebindableBlockEntityTicker>, binding: &Arc<BoundBlockEntityTicker>, )
Trait Implementations§
Source§impl Default for WorldBlockEntityTickers
impl Default for WorldBlockEntityTickers
Source§fn default() -> WorldBlockEntityTickers
fn default() -> WorldBlockEntityTickers
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for WorldBlockEntityTickers
impl !RefUnwindSafe for WorldBlockEntityTickers
impl !UnwindSafe for WorldBlockEntityTickers
impl Send for WorldBlockEntityTickers
impl Sync for WorldBlockEntityTickers
impl Unpin for WorldBlockEntityTickers
impl UnsafeUnpin for WorldBlockEntityTickers
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
§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<>>