From 7d99d23aefd60d78b9bbdbdf4e80f8557b89b9cb Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Tue, 27 Oct 2026 21:57:14 +0100 Subject: [PATCH] Fix beacon beam distance and cull at render distance The beam width used x and y instead of the horizontal distance, so it was wrong for beacons to the north or south. Beams beyond render distance x 16 are skipped, as BeaconRenderer.shouldRender does. A beacon with Levels 0 still draws no beam. --- crates/horizon-client/src/game/beacon.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/horizon-client/src/game/beacon.rs b/crates/horizon-client/src/game/beacon.rs index 6de017c33..710b743ac 100644 --- a/crates/horizon-client/src/game/beacon.rs +++ b/crates/horizon-client/src/game/beacon.rs @@ -563,13 +563,21 @@ impl Game<'_> { }; let time = (self.world.game_time.rem_euclid(40)) as f32 + alpha as f32; let scoping = self.scoping(); + let view = f64::from(self.settings.render_distance * 16); for (k, e) in &self.world.block_entities { let BlockEntity::Beacon(b) = e else { continue }; + // `getBeamSections` is empty while Levels is 0. if b.levels == 0 || b.sections.is_empty() { continue; } let base = glam::DVec3::new(f64::from(k.0) + 0.5, f64::from(k.1), f64::from(k.2) + 0.5); - let distance = (base - camera).truncate().length() as f32; + // `BeaconRenderer.shouldRender`: horizontal distance under render distance × 16. + let offset = base - camera; + let horizontal = glam::DVec2::new(offset.x, offset.z).length(); + if horizontal >= view { + continue; + } + let distance = horizontal as f32; let scale = if scoping { 1.0 } else {