From 7d99d23aefd60d78b9bbdbdf4e80f8557b89b9cb Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Tue, 27 Oct 2026 21:57:14 +0100 Subject: [PATCH 1/4] 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 { From 52f3dcc5ef265269668ad29eaf9566eba4093b94 Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Tue, 27 Oct 2026 21:57:14 +0100 Subject: [PATCH 2/4] Use christmas chest textures on 24-26 December Normal and trapped chests use the christmas sprites on 24-26 December, as ChestRenderer does, with the local date read once. minecraft:local_time reads the system time zone instead of UTC, so the Christmas chest item switches on the local date. --- .../horizon-client/src/block_entity_render.rs | 24 +++++++++++++++++++ crates/horizon-client/src/game/item_draw.rs | 8 +++---- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/crates/horizon-client/src/block_entity_render.rs b/crates/horizon-client/src/block_entity_render.rs index ecad13fb1..280dd9d21 100644 --- a/crates/horizon-client/src/block_entity_render.rs +++ b/crates/horizon-client/src/block_entity_render.rs @@ -97,6 +97,16 @@ pub fn diffuse(normal: Vec3, lights: (Vec3, Vec3)) -> f32 { pub fn vertex_light(packed: u8) -> u32 { (u32::from(packed >> 4) * 16) | ((u32::from(packed & 15) * 16) << 8) } +/// `ChestRenderer.xmasTextures`: `SpecialDates.isExtendedChristmas` (24 to 26 +/// December in the local time zone), read once when the renderer is created. +fn extended_christmas() -> bool { + use chrono::Datelike; + static XMAS: std::sync::OnceLock = std::sync::OnceLock::new(); + *XMAS.get_or_init(|| { + let now = chrono::Local::now(); + now.month() == 12 && (24..=26).contains(&now.day()) + }) +} fn pack_color(rgb: u32, alpha: u32, brightness: f32) -> u32 { let c = |shift: u32| (((rgb >> shift) & 255) as f32 * brightness) as u32; alpha << 24 | c(0) << 16 | c(8) << 8 | c(16) @@ -1173,11 +1183,25 @@ impl BlockEntityRenderer { } } Kind::Chest { + block, texture, part, y_rot, .. } => { + // ChestRenderer.getChestMaterial: normal and trapped chests use the christmas + // sprites on 24-26 December. Copper and ender chests keep theirs. + let texture = if matches!(block.as_str(), "chest" | "trapped_chest") + && extended_christmas() + { + match part { + ChestPart::Single => "entity/chest/christmas", + ChestPart::Left => "entity/chest/christmas_left", + ChestPart::Right => "entity/chest/christmas_right", + } + } else { + *texture + }; let model = match part { ChestPart::Single => "chest", ChestPart::Left => "double_chest_left", diff --git a/crates/horizon-client/src/game/item_draw.rs b/crates/horizon-client/src/game/item_draw.rs index be0ca56fb..354e837b1 100644 --- a/crates/horizon-client/src/game/item_draw.rs +++ b/crates/horizon-client/src/game/item_draw.rs @@ -82,11 +82,11 @@ fn civil(days: i64) -> (i64, u32, u32) { (yoe + era * 400 + i64::from(m <= 2), m, d) } /// `DateTimeFormatter.ofPattern(pattern).format(now)` for the month, day, -/// year and time letters item models use (UTC: no time zone database). +/// year and time letters item models use, in the system time zone +/// (`LocalTime` without a `time_zone`). pub(super) fn local_time(pattern: &str) -> String { - let secs = std::time::SystemTime::now() - .duration_since(std::time::UNIX_EPOCH) - .map_or(0, |d| d.as_secs() as i64); + let now = chrono::Local::now(); + let secs = now.timestamp() + i64::from(now.offset().local_minus_utc()); let (y, mo, d) = civil(secs.div_euclid(86_400)); let s = secs.rem_euclid(86_400); let (h, mi, se) = (s / 3600, s / 60 % 60, s % 60); From 5b41d9ebf339c4b99d7da28b3cfb2a2245b075d3 Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Tue, 27 Oct 2026 21:57:14 +0100 Subject: [PATCH 3/4] Light glow frame maps at 15728850 A map in a glow item frame is drawn at light 15728850 (sky 15, block 13), not full bright, as ItemFrameRenderer does. --- crates/horizon-client/src/game/frames.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/horizon-client/src/game/frames.rs b/crates/horizon-client/src/game/frames.rs index 4b7465bd0..f347e8151 100644 --- a/crates/horizon-client/src/game/frames.rs +++ b/crates/horizon-client/src/game/frames.rs @@ -429,7 +429,8 @@ impl Game<'_> { if let Some(id) = map { // ItemFrameRenderer: the map fills the face, in 90-degree steps. let depth = if f.invisible { 0.5 } else { 0.4375 }; - let item_light = if f.glow { 240 | 240 << 8 } else { packed }; + // A glow frame's map is 15728850 (sky 15, block 13), not full bright. + let item_light = if f.glow { 240 | 208 << 8 } else { packed }; let m = pose * glam::DMat4::from_translation(glam::DVec3::new(0.0, 0.0, depth)) * glam::DMat4::from_rotation_z( From e0bb0881e845f5df7bf7afd5823acda5b7cce95f Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Tue, 27 Oct 2026 22:36:57 +0100 Subject: [PATCH 4/4] item frames: glow frame map light is block coordinate 210, as vanilla's 15728850 15728850 is 0xF000D2: sky coordinate 240 and block coordinate 210, which the packed light here stores as 240 | 210 << 8 (208 was 13 * 16). Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/game/frames.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/horizon-client/src/game/frames.rs b/crates/horizon-client/src/game/frames.rs index f347e8151..99e82cf6d 100644 --- a/crates/horizon-client/src/game/frames.rs +++ b/crates/horizon-client/src/game/frames.rs @@ -429,8 +429,9 @@ impl Game<'_> { if let Some(id) = map { // ItemFrameRenderer: the map fills the face, in 90-degree steps. let depth = if f.invisible { 0.5 } else { 0.4375 }; - // A glow frame's map is 15728850 (sky 15, block 13), not full bright. - let item_light = if f.glow { 240 | 208 << 8 } else { packed }; + // A glow frame's map is 15728850 = 0xF000D2 (sky coordinate 240, + // block coordinate 210), not full bright. + let item_light = if f.glow { 240 | 210 << 8 } else { packed }; let m = pose * glam::DMat4::from_translation(glam::DVec3::new(0.0, 0.0, depth)) * glam::DMat4::from_rotation_z(