From 6b8fde092ff6bc41b0b5fd84fff03498161fcc8c Mon Sep 17 00:00:00 2001 From: socksprox Date: Mon, 26 Oct 2026 11:20:21 +0100 Subject: [PATCH] Keep 26.3's name-tag and text-display values Review caught three regressions against the pinned client jar: submitInner lines stay lineHeight+1 (10 px), submitNameTag fades discrete and see-through names with the same 0x7F, and lightCoordsWithEmission floors both light channels at 2. Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- crates/horizon-client/src/game/names.rs | 22 +++++-------------- .../horizon-client/src/game/text_displays.rs | 4 ++-- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/crates/horizon-client/src/game/names.rs b/crates/horizon-client/src/game/names.rs index d62e064f7..f49550f77 100644 --- a/crates/horizon-client/src/game/names.rs +++ b/crates/horizon-client/src/game/names.rs @@ -252,27 +252,17 @@ impl Game<'_> { out: &mut Vec, see_through: &mut Vec, ) { - // renderNameTag's text colours: a discrete name's faded 0x20FFFFFF, - // the see-through copy's 0x80FFFFFF. - const DISCRETE: u32 = 0x20; - const FADED: u32 = 0x80; + // The text alpha that goes with getBackgroundOpacity(0.25): + // max((0.25 + 0.75) / 2, 0.5), as ARGB.color (the floor of 255 times it). + const FADED: u32 = 0x7F; for tag in self.name_tags(camera, alpha) { let o = tag.at - camera; if tag.discrete { - self.name_tag_quads( - o, - &tag.lines, - DISCRETE, - true, - 0, - vertex_light(tag.light), - out, - ); + self.name_tag_quads(o, &tag.lines, FADED, true, 0, vertex_light(tag.light), out); continue; } - // LightCoordsUtil.lightCoordsWithEmission(lightCoords, 2): the block - // channel at least 2, the sky channel unchanged. - let lit = (tag.light & 0xF0) | (tag.light & 15).max(2); + // LightCoordsUtil.lightCoordsWithEmission(lightCoords, 2). + let lit = (tag.light >> 4).max(2) << 4 | (tag.light & 15).max(2); self.name_tag_quads(o, &tag.lines, 0xFF, false, 0, vertex_light(lit), out); // RenderPipelines.TEXT_SEE_THROUGH: no depth test, no lightmap. self.name_tag_quads(o, &tag.lines, FADED, true, 2, 0, see_through); diff --git a/crates/horizon-client/src/game/text_displays.rs b/crates/horizon-client/src/game/text_displays.rs index 45191e15e..b669c8357 100644 --- a/crates/horizon-client/src/game/text_displays.rs +++ b/crates/horizon-client/src/game/text_displays.rs @@ -198,7 +198,7 @@ impl Game<'_> { Lines { lines, width } }); let width = *width; - let height = lines.len() as f32 * 9.0 - 1.0; + let height = lines.len() as f32 * 10.0 - 1.0; matrix *= glam::Mat4::from_translation(glam::Vec3::new(1.0 - width / 2.0, -height, 0.0)); let mut batch = HudBatch::new([1, 1]); @@ -233,7 +233,7 @@ impl Game<'_> { atlas, line, x, - i as f32 * 9.0, + i as f32 * 10.0, rgba(255, 255, 255, d.opacity as u8), d.flags & 1 != 0, );