pub(crate) struct TimedChunkTickets {
tickets: Vec<TimedChunkTicket>,
}Expand description
Timed chunk tickets owned by vanilla gameplay systems.
Fields§
§tickets: Vec<TimedChunkTicket>Implementations§
Source§impl TimedChunkTickets
impl TimedChunkTickets
Sourcepub(crate) fn from_persistent(persistent: PersistentChunkTickets) -> Self
pub(crate) fn from_persistent(persistent: PersistentChunkTickets) -> Self
Restores timed tickets from persistent saved data.
Sourcepub(crate) fn to_persistent(&self) -> PersistentChunkTickets
pub(crate) fn to_persistent(&self) -> PersistentChunkTickets
Converts active timed tickets to persistent saved data.
Sourcepub(crate) fn activate_all(&self, ticket_manager: &mut ChunkTicketManager)
pub(crate) fn activate_all(&self, ticket_manager: &mut ChunkTicketManager)
Inserts restored timed ticket sources into the active ticket manager.
Sourcepub(crate) fn add_portal_ticket(&mut self, pos: ChunkPos) -> Option<ChunkTicket>
pub(crate) fn add_portal_ticket(&mut self, pos: ChunkPos) -> Option<ChunkTicket>
Adds or refreshes vanilla’s portal ticket.
Sourcepub(crate) fn add_ender_pearl_ticket(
&mut self,
pos: ChunkPos,
) -> Option<ChunkTicket>
pub(crate) fn add_ender_pearl_ticket( &mut self, pos: ChunkPos, ) -> Option<ChunkTicket>
Adds or refreshes vanilla’s in-flight ender pearl ticket.
Sourcepub(crate) fn tick(
&mut self,
can_expire: impl FnMut(ChunkPos) -> bool,
) -> Vec<(ChunkPos, ChunkTicket)>
pub(crate) fn tick( &mut self, can_expire: impl FnMut(ChunkPos) -> bool, ) -> Vec<(ChunkPos, ChunkTicket)>
Decrements timed tickets and returns sources that expired this tick.
fn add_or_reset( &mut self, kind: TimedChunkTicketKind, pos: ChunkPos, ticket: ChunkTicket, ticks_left: i64, ) -> Option<ChunkTicket>
fn add_loaded_persistent_ticket(&mut self, persistent: PersistentChunkTicket)
fn add_loaded_portal_ticket(&mut self, pos: ChunkPos, ticks_left: i64)
Trait Implementations§
Source§impl Debug for TimedChunkTickets
impl Debug for TimedChunkTickets
Source§impl Default for TimedChunkTickets
impl Default for TimedChunkTickets
Source§fn default() -> TimedChunkTickets
fn default() -> TimedChunkTickets
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TimedChunkTickets
impl RefUnwindSafe for TimedChunkTickets
impl Send for TimedChunkTickets
impl Sync for TimedChunkTickets
impl Unpin for TimedChunkTickets
impl UnsafeUnpin for TimedChunkTickets
impl UnwindSafe for TimedChunkTickets
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<>>