From 6dcf4b3e8bbe734a1d906111405875ecee668579 Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Mon, 26 Oct 2026 18:45:43 +0100 Subject: [PATCH] Use the real local difficulty for the phantom spawn check The phantom spawn gate assumed a fixed effective difficulty of 2. Use the local difficulty at the player instead, so easy, hard, a long-played chunk and the moon phase change how often phantoms spawn. --- crates/horizon-client/src/game/stats.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/horizon-client/src/game/stats.rs b/crates/horizon-client/src/game/stats.rs index 7f64c6bb2..c653bf265 100644 --- a/crates/horizon-client/src/game/stats.rs +++ b/crates/horizon-client/src/game/stats.rs @@ -366,9 +366,10 @@ impl Game<'_> { if pos[1] < 63 || !self.can_see_sky(pos) { return; } - // DifficultyInstance.isHarderThan(random * 3) at normal difficulty. + // `getCurrentDifficultyAt(playerPos).isHarderThan(random * 3)`. + let difficulty = self.local_difficulty([position.x, position.y, position.z]); let r = &mut self.world.random; - if r.next_float() * 3.0 >= 2.0 { + if difficulty.effective <= r.next_float() * 3.0 { return; } if r.next_int_bound(since_rest.max(1)).unwrap_or(0) < 72000 {