From 1d93086e33a212b3a263f459fdb75d61e5895e49 Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Mon, 26 Oct 2026 22:39:50 +0100 Subject: [PATCH] Ease the night vision pulse with the partial tick The last 10 seconds of Night Vision pulse in brightness. Vanilla reads the pulse at (duration - partial tick), so it eases between ticks. Horizon used the whole tick count, so the brightness stepped once per tick. --- crates/horizon-client/src/game.rs | 2 +- crates/horizon-client/src/game/sculk.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/horizon-client/src/game.rs b/crates/horizon-client/src/game.rs index 7596ee871..e568fa5a9 100644 --- a/crates/horizon-client/src/game.rs +++ b/crates/horizon-client/src/game.rs @@ -10990,7 +10990,7 @@ impl Game<'_> { }), ticks: self.ticks, darkness: self.darkness_lighting(alpha as f32), - night_vision: self.night_vision_intensity(), + night_vision: self.night_vision_intensity(alpha as f32), block_flicker: self.fog.block_light_flicker, boss_darken: self .boss_overlay diff --git a/crates/horizon-client/src/game/sculk.rs b/crates/horizon-client/src/game/sculk.rs index 7916c46a1..473509f0a 100644 --- a/crates/horizon-client/src/game/sculk.rs +++ b/crates/horizon-client/src/game/sculk.rs @@ -1194,14 +1194,14 @@ impl Game<'_> { /// `LightmapRenderStateExtractor`: the night vision effect's intensity /// (`GameRenderer.nightVisionScale`), or conduit power's water vision. - pub(super) fn night_vision_intensity(&self) -> f32 { + pub(super) fn night_vision_intensity(&self, partial: f32) -> f32 { use horizon_client::fog::FogType; if let Some(e) = self.potions.effects.get("night_vision") { // MobEffectInstance.endsWithin(200); -1 is infinite. return if e.duration < 0 || e.duration > 200 { 1.0 } else { - 0.7 + (e.duration as f32 * std::f32::consts::PI * 0.2).sin() * 0.3 + 0.7 + ((e.duration as f32 - partial) * std::f32::consts::PI * 0.2).sin() * 0.3 }; } if self.potions.effects.get("conduit_power").is_some()