From f58413cbbf4a664175db87eba2893a4a6ca73f22 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Sat, 10 Oct 2026 20:02:40 +0200 Subject: [PATCH] Random-tick only sections holding randomly ticking states The client random-ticked every section with a non-air block, drawing getBlockRandomPos positions vanilla never draws. It now ticks a section only when its palette holds a randomly ticking state, as LevelChunkSection.isRandomlyTicking does (lava counts through LiquidBlock). Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/game.rs | 6 +++++- docs/parity/blocks.md | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/horizon-client/src/game.rs b/crates/horizon-client/src/game.rs index 00e025094..3c5236e87 100644 --- a/crates/horizon-client/src/game.rs +++ b/crates/horizon-client/src/game.rs @@ -1318,15 +1318,19 @@ impl Game<'_> { ); let simulation = self.settings.render_distance.min(8); let mut ticking = Vec::new(); + let facts = &self.res.facts; for (&(x, z), chunk) in &self.world.chunks { if (x - pcx).abs() > simulation || (z - pcz).abs() > simulation || !chunk.lit { continue; } + // LevelChunkSection.isRandomlyTicking: a randomly ticking block or + // fluid state (lava reports both through LiquidBlock). The palette + // stands in for vanilla's exact counts. let sections: Vec = chunk .sections .iter() .enumerate() - .filter(|(_, s)| !s.is_uniform(0)) + .filter(|(_, s)| s.blocks.maybe_has(|id| facts.get(BlockStateId(id)).random_ticks)) .map(|(i, _)| MIN_Y + i as i32 * 16) .collect(); ticking.push((x, z, sections)); diff --git a/docs/parity/blocks.md b/docs/parity/blocks.md index b9e88d06f..0ecd1db48 100644 --- a/docs/parity/blocks.md +++ b/docs/parity/blocks.md @@ -145,9 +145,9 @@ containers, weather-driven blocks. The library code lives in - Features placed from block behaviour draw from a copy of the level random. Their `next_world_*` draws and any draws in neighbour updates during placement do not reach the real stream. - - Client sections that hold any non-air block get random ticks, not only - sections with randomly ticking states. This advances the - `getBlockRandomPos` generator more often than vanilla does. + - The client picks randomly ticking sections from their palettes, so a + section whose palette still lists a ticking state no block uses any more + gets random ticks that vanilla's exact counts would skip. - **Explosion details.** Exposure uses full-collision blocks only. `getEntities` order is approximate. Experience orbs, falling blocks and arrows are not pushed.