From f56785c2f512eef6eff83687455cbee97ecbcd11 Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Sun, 25 Oct 2026 13:16:16 +0100 Subject: [PATCH 1/2] Keep a chunk's scheduled ticks when it unloads before the next tick attach_save_data took a chunk's ticks only from the tick scheduler, which registers new chunks once a tick. A chunk loaded and unloaded again in between was saved with its block and fluid ticks cleared, though its own saved list still held them. --- crates/horizon-client/src/game/persist.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/horizon-client/src/game/persist.rs b/crates/horizon-client/src/game/persist.rs index d3afbf6ce..45ef8801f 100644 --- a/crates/horizon-client/src/game/persist.rs +++ b/crates/horizon-client/src/game/persist.rs @@ -76,15 +76,14 @@ impl Game<'_> { let pos = ChunkPos::new(chunk.x, chunk.z); let time = self.world.game_time; let mut extras: ChunkExtras = chunk.saved.as_deref().cloned().unwrap_or_default(); + // A chunk the scheduler hasn't registered yet (one loaded and + // unloaded again before the next tick) still holds its saved ticks: + // `register_chunk_ticks` empties that list once it takes them. if let Some(t) = self.block_ticks.blocks.chunk(pos) { extras.block_ticks = t.pack(time); - } else { - extras.block_ticks.clear(); } if let Some(t) = self.block_ticks.fluids.chunk(pos) { extras.fluid_ticks = t.pack(time); - } else { - extras.fluid_ticks.clear(); } extras.last_update = time; // TheEndGatewayBlockEntity saves its Age (the server copy's). From e181b17e17a88f6c39fbb16dd4b81440d8e738e1 Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Sun, 25 Oct 2026 13:16:16 +0100 Subject: [PATCH 2/2] Register new chunks' ticks before post-processing them postprocess_chunks ran before tick_blocks registered the chunks that arrived since the last tick, so the fluid and block ticks their marks schedule went to chunks the scheduler did not know and were dropped. Vanilla registers a chunk's tick containers before postProcessGeneration. --- crates/horizon-client/src/game/postprocess.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/horizon-client/src/game/postprocess.rs b/crates/horizon-client/src/game/postprocess.rs index e896a77ab..77cba6832 100644 --- a/crates/horizon-client/src/game/postprocess.rs +++ b/crates/horizon-client/src/game/postprocess.rs @@ -27,6 +27,11 @@ impl Game<'_> { if ready.is_empty() { return Ok(()); } + // The ticks the marks schedule go to the chunks' containers, which a + // chunk that arrived since the last tick doesn't have yet + // (`LevelChunk.registerTickContainerInLevel` comes before + // `postProcessGeneration`). + self.sync_tick_chunks(); for key in ready { let Some(chunk) = self.world.chunks.get_mut(&key) else { continue;