Skip to main content

Module tick_scheduler

Module tick_scheduler 

Source
Expand description

Scheduled tick storage and selection for deterministic block and fluid updates.

Scheduled ticks are stored in per-chunk priority queues against absolute world game time. Within a chunk, the queue follows vanilla’s ScheduledTick.DRAIN_ORDER: trigger time, priority, then sub-tick order. Across chunks, only each ready queue head participates in selection, following vanilla’s LevelTicks container-draining behavior.

Saved and proto-chunk ticks remain pending until the chunk first reaches confirmed block-ticking readiness. That transition anchors their saved delays to the current game time, matching LevelChunkTicks.unpack. Later readiness demotions do not pause or re-anchor those deadlines.

§Exact cross-chunk ties

Each loaded chunk reconstructs saved ticks with its own negative sub-tick order range, so two ready chunk heads can have the same priority and sub-tick order. A WorldGenRegion also owns an independent counter, as in Vanilla, and can retain that order when it schedules directly into an already-Full dependency chunk. Vanilla’s final order for these exact ties follows iteration of fastutil’s Long2LongOpenHashMap and then Java’s PriorityQueue heap behavior. Minecraft supplies no custom hash strategy for that map. As an intentional performance tradeoff, Steel keeps the optimized scc chunk traversal as the final tie order instead of reproducing implementation-specific Java collection state. Ordinary live-world ticks still use a world-global sub-tick counter.

§Exact intra-chunk ties

Vanilla’s LevelChunkTicks comparator leaves ticks with identical trigger time, priority, and sub-tick order equal, so their final order depends on Java collection and priority-queue history. Steel intentionally drains those otherwise indistinguishable ticks in insertion order instead of reproducing that implementation-specific state.

Modules§

list 🔒
World index for registered Full-chunk scheduled block and fluid containers.
run_batch 🔒
scheduler 🔒
world 🔒

Structs§

ChunkTickContainer 🔒
Stable scheduled-tick storage owned by one chunk from creation through unload.
ChunkTickContainerState 🔒
ChunkTickLists 🔒
Block and fluid scheduled-tick queues belonging to one chunk.
ChunkTickPackingSnapshot 🔒
SavedTick 🔒
A scheduled tick in the chunk persistence representation.
ScheduledTick
A single scheduled tick targeting a block or fluid at a specific position.
ScheduledTickBatch 🔒
Ready ticks and the active containers whose persisted delays changed.
ScheduledTickSnapshot 🔒
Owned persistence snapshot of both scheduled-tick queues for a Full chunk.

Enums§

ChunkTickContainerLifecycle 🔒
TickPriority
Priority levels for scheduled ticks. Lower discriminant = higher priority.
TickSchedulerError 🔒
A violated Full-chunk scheduled-tick ownership invariant.

Traits§

TickKey
Trait for types that can be used as the tick target in ScheduledTick.

Type Aliases§

BlockTick
A scheduled tick targeting a block.
BlockTickList
Per-chunk storage for scheduled block ticks.
FluidTick
A scheduled tick targeting a fluid.
FluidTickList
Per-chunk storage for scheduled fluid ticks.
ScheduledTickKey
Deduplication key used by scheduled tick containers and execution snapshots.