[PR #7906] effect modifiers widen vanilla's float literals #7888

Open
opened 2026-11-03 07:26:12 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7906
Author: @grkthegreat2018-bot
Created: 11/3/2026
Status: 🔄 Open

Base: main ← Head: fix/7888-effect-modifier-floats


📝 Commits (1)

  • 17a0cee effect modifiers widen vanilla's float literals

📊 Changes

1 file changed (+7 additions, -5 deletions)

View changed files

📝 crates/horizon-client-render/src/effects.rs (+7 -5)

📄 Description

🤖 Opened by GRKTheGreat's AI agent (Devin, SWE-2 Max), not by GRKTheGreat personally.

What and why

effect_modifier wrote Speed, Slowness, Haste and Mining Fatigue amounts as
double literals where MobEffects uses float literals widened into the double
modifier, so the low digits differ: a zombie with Speed I syncs movement speed
0.27600000500679017 where vanilla gives 0.2760000056922436. The four
amounts are now f64::from of the f32, as the mob table in
mobs/finalize.rs already writes them.

Fixes #7888.

Kind

  • parity: Horizon now does what vanilla 26.3 does

Vanilla reference

  • MobEffects.SPEED/MOVEMENT_SLOWDOWN/DIG_SPEED/DIG_SLOWDOWN
    (MobEffects.java: addAttributeModifier(Holder, Identifier, double, Operation)
    takes the 0.2F/−0.15F/0.1F/−0.1F literal widened to double)

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick on GRKTheGreat, against origin/main at 31f83499b, 3 min 45 s)

Check Result
Scope ✅ 1 files, +7 −5
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 614 passed (1 min 11 s)
rustfmt ✅ (8 s)
clippy ✅ (27 s)
tests: horizon-client-render ✅ 1183 passed (1 min 56 s)
doc tests ✅ 0 passed (1 s)
content root tests ➖ content root untouched
mod API up to date ➖ native hooks untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Devin


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/7906 **Author:** [@grkthegreat2018-bot](https://github.com/grkthegreat2018-bot) **Created:** 11/3/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/7888-effect-modifier-floats` --- ### 📝 Commits (1) - [`17a0cee`](https://github.com/horizon-rust/horizon/commit/17a0cee571665a277f47a4adc689ca0144cbc86c) effect modifiers widen vanilla's float literals ### 📊 Changes **1 file changed** (+7 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/effects.rs` (+7 -5) </details> ### 📄 Description > 🤖 Opened by GRKTheGreat's AI agent (Devin, SWE-2 Max), not by GRKTheGreat personally. ## What and why `effect_modifier` wrote Speed, Slowness, Haste and Mining Fatigue amounts as double literals where `MobEffects` uses float literals widened into the double modifier, so the low digits differ: a zombie with Speed I syncs movement speed `0.27600000500679017` where vanilla gives `0.2760000056922436`. The four amounts are now `f64::from` of the `f32`, as the mob table in `mobs/finalize.rs` already writes them. Fixes #7888. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does ## Vanilla reference - `MobEffects.SPEED`/`MOVEMENT_SLOWDOWN`/`DIG_SPEED`/`DIG_SLOWDOWN` (`MobEffects.java`: `addAttributeModifier(Holder, Identifier, double, Operation)` takes the `0.2F`/`−0.15F`/`0.1F`/`−0.1F` literal widened to double) ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on GRKTheGreat, against origin/main at 31f83499b, 3 min 45 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +7 −5 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 614 passed (1 min 11 s) | | rustfmt | ✅ (8 s) | | clippy | ✅ (27 s) | | tests: horizon-client-render | ✅ 1183 passed (1 min 56 s) | | doc tests | ✅ 0 passed (1 s) | | content root tests | ➖ content root untouched | | mod API up to date | ➖ native hooks untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Devin](https://devin.ai) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#7888
No description provided.