pub(crate) struct WorldTickScheduler {
next_sub_tick_order: AtomicI64,
phase: SyncRwLock<()>,
pub(super) state: SyncMutex<WorldTickSchedulerState>,
}Fields§
§next_sub_tick_order: AtomicI64§phase: SyncRwLock<()>§state: SyncMutex<WorldTickSchedulerState>Implementations§
Source§impl WorldTickScheduler
impl WorldTickScheduler
pub(crate) fn new() -> Self
Sourcepub(crate) fn next_sub_tick_order(&self) -> i64
pub(crate) fn next_sub_tick_order(&self) -> i64
Allocates the world-global order before container lookup or deduplication.
Vanilla creates the ScheduledTick before asking LevelTicks to store
it, so failed and duplicate scheduling attempts consume an order too.
Sourcepub(crate) fn register_chunk(
&self,
chunk: FullChunkRef<'_>,
) -> Result<(), TickSchedulerError>
pub(crate) fn register_chunk( &self, chunk: FullChunkRef<'_>, ) -> Result<(), TickSchedulerError>
Registers an unpublished Full chunk’s stable queues with the world index.
Sourcepub(crate) fn unpack_chunk(
&self,
pos: ChunkPos,
current_tick: i64,
) -> Result<(), TickSchedulerError>
pub(crate) fn unpack_chunk( &self, pos: ChunkPos, current_tick: i64, ) -> Result<(), TickSchedulerError>
Anchors saved/proto delays when a Full chunk first becomes block-ticking.
TickList::unpack is idempotent, so later readiness promotions preserve
the original absolute deadlines.
Sourcepub(crate) fn unregister_chunk(&self, pos: ChunkPos)
pub(crate) fn unregister_chunk(&self, pos: ChunkPos)
Removes a finally-unloaded Full chunk after its last save completed.
Sourcepub(crate) fn reconcile_active_chunks<I>(
&self,
active_chunks: I,
) -> Result<(), TickSchedulerError>
pub(crate) fn reconcile_active_chunks<I>( &self, active_chunks: I, ) -> Result<(), TickSchedulerError>
Reconciles the active sparse deadline index at a rare ticking-snapshot rebuild.
pub(crate) fn schedule_block( &self, chunk: FullChunkRef<'_>, block: BlockRef, pos: BlockPos, trigger_tick: i64, priority: TickPriority, sub_tick_order: i64, ) -> Result<bool, TickSchedulerError>
pub(crate) fn schedule_fluid( &self, chunk: FullChunkRef<'_>, fluid: FluidRef, pos: BlockPos, trigger_tick: i64, priority: TickPriority, sub_tick_order: i64, ) -> Result<bool, TickSchedulerError>
Sourcepub(crate) fn begin_tick(
&self,
current_tick: i64,
max_ticks: usize,
) -> ScheduledTickBatch<BlockRef>
pub(crate) fn begin_tick( &self, current_tick: i64, max_ticks: usize, ) -> ScheduledTickBatch<BlockRef>
Selects the ready block batch from sparse live-container heads.
Sourcepub(crate) fn collect_fluid_ticks(
&self,
current_tick: i64,
max_ticks: usize,
) -> ScheduledTickBatch<FluidRef>
pub(crate) fn collect_fluid_ticks( &self, current_tick: i64, max_ticks: usize, ) -> ScheduledTickBatch<FluidRef>
Selects fluids after block callbacks using the same captured game time.
fn collect_ticks<T: TickKey>( &self, kind: TickKind, select: fn(&mut ChunkTickLists) -> &mut TickList<T>, current_tick: i64, max_ticks: usize, ) -> ScheduledTickBatch<T>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for WorldTickScheduler
impl !RefUnwindSafe for WorldTickScheduler
impl !UnwindSafe for WorldTickScheduler
impl Send for WorldTickScheduler
impl Sync for WorldTickScheduler
impl Unpin for WorldTickScheduler
impl UnsafeUnpin for WorldTickScheduler
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<>>