[PR #1823] [MERGED] Wither roses give the player Wither #3794

Closed
opened 2026-11-03 04:12:21 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1823
Author: @vlesmentie
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @ludovic111

Base: main ← Head: fix/wither-rose-player


📝 Commits (1)

  • 5fb0cad Wither roses give the player Wither

📊 Changes

4 files changed (+95 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+1 -0)
📝 crates/horizon-client/src/game/creatures.rs (+10 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+6 -0)
📝 crates/horizon-client/src/motion.rs (+78 -1)

📄 Description

🤖 Opened by vlesmentie's AI agent (Claude Code, Claude Opus 5.5), not by vlesmentie themselves.

What and why

Fixes #1319.

Standing in a wither rose never gave the player Wither, in either singleplayer mode. The player's inside-block
dispatch (MotionWorld::check_inside_blocks) had cases for cactus, campfires, sweet berry bushes, cobwebs, powder
snow, bubble columns and nether portals, but none for the wither rose.

  • motion.rs: the sweep emits a new MotionEvent::InsideWitherRose for each wither rose the player's box is inside,
    in the same part of the dispatch as cactus and campfires, so it runs both for the game's own player and for a
    server's player (server_block_damage).
  • game/creatures.rs: wither_rose_contact adds Wither for 40 ticks unless the world is peaceful, through
    give_player_effect (which already skips creative and spectator players). A client of a server leaves it to the
    server (remote.is_some()).
  • game.rs handles the event for the game's own player; game/lan_actions.rs handles it for a server's player
    while acting as that guest (its game mode and effects are swapped in), before tick_mob_effects as in
    LivingEntity.baseTick.

Vanilla reference

  • WitherRoseBlock.entityInside: on a ServerLevel whose difficulty isn't PEACEFUL, a LivingEntity that is not
    isInvulnerableTo(level, damageSources().wither()) gets addEffect(getBeeInteractionEffect())
  • WitherRoseBlock.getBeeInteractionEffect: new MobEffectInstance(MobEffects.WITHER, 40)
  • Player.isInvulnerableTo / Entity.isInvulnerableTo: invulnerable abilities (creative, spectator) block it, as
    wither damage doesn't bypass invulnerability

Checked against the 26.3 client jar's bytecode (javap).

New test motion::tests::standing_in_a_wither_rose_asks_for_its_effect: a rose in a test scene, one tick for the
game's own player and one server_block_damage for a server's player each emit the event once, and a player two
blocks away emits none. Like the other motion.rs scene tests it needs prepared resources (and honours
HORIZON_TEST_RESOURCES); run here against the launcher's prepared v0.2.55 resources it passes, and fails without
the motion.rs change.

Self-check

pr_ready (tools/pr_ready.py on debian, against origin/main at 6a065fa48, 5 min 59 s)

Check Result
Scope ✅ 4 files, +95 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (17 s)
clippy ✅ (1 min 35 s)
tests: horizon-client ❌ 1099 passed, 1 failed (4 min 2 s)
doc tests ✅ 0 passed (5 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (no vanilla data here): 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)

The one failing test, packs::cache::tests::zip_content_and_failed_build_invalidate, fails the same way on main at 6a065fa48 on this machine without this change (the archive with an unsupported compression method builds instead of failing, packs/cache.rs:561); it doesn't touch anything this PR changes.

Not checked in game.

🤖 Generated with Claude Code


🔄 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/1823 **Author:** [@vlesmentie](https://github.com/vlesmentie) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/wither-rose-player` --- ### 📝 Commits (1) - [`5fb0cad`](https://github.com/horizon-rust/horizon/commit/5fb0cad6e7a520365e78b2635884af970493e11d) Wither roses give the player Wither ### 📊 Changes **4 files changed** (+95 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+1 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+10 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+6 -0) 📝 `crates/horizon-client/src/motion.rs` (+78 -1) </details> ### 📄 Description > 🤖 Opened by vlesmentie's AI agent (Claude Code, Claude Opus 5.5), not by vlesmentie themselves. ## What and why Fixes #1319. Standing in a wither rose never gave the player Wither, in either singleplayer mode. The player's inside-block dispatch (`MotionWorld::check_inside_blocks`) had cases for cactus, campfires, sweet berry bushes, cobwebs, powder snow, bubble columns and nether portals, but none for the wither rose. - `motion.rs`: the sweep emits a new `MotionEvent::InsideWitherRose` for each wither rose the player's box is inside, in the same part of the dispatch as cactus and campfires, so it runs both for the game's own player and for a server's player (`server_block_damage`). - `game/creatures.rs`: `wither_rose_contact` adds Wither for 40 ticks unless the world is peaceful, through `give_player_effect` (which already skips creative and spectator players). A client of a server leaves it to the server (`remote.is_some()`). - `game.rs` handles the event for the game's own player; `game/lan_actions.rs` handles it for a server's player while acting as that guest (its game mode and effects are swapped in), before `tick_mob_effects` as in `LivingEntity.baseTick`. ## Vanilla reference - `WitherRoseBlock.entityInside`: on a `ServerLevel` whose difficulty isn't `PEACEFUL`, a `LivingEntity` that is not `isInvulnerableTo(level, damageSources().wither())` gets `addEffect(getBeeInteractionEffect())` - `WitherRoseBlock.getBeeInteractionEffect`: `new MobEffectInstance(MobEffects.WITHER, 40)` - `Player.isInvulnerableTo` / `Entity.isInvulnerableTo`: invulnerable abilities (creative, spectator) block it, as wither damage doesn't bypass invulnerability Checked against the 26.3 client jar's bytecode (`javap`). New test `motion::tests::standing_in_a_wither_rose_asks_for_its_effect`: a rose in a test scene, one tick for the game's own player and one `server_block_damage` for a server's player each emit the event once, and a player two blocks away emits none. Like the other `motion.rs` scene tests it needs prepared resources (and honours `HORIZON_TEST_RESOURCES`); run here against the launcher's prepared v0.2.55 resources it passes, and fails without the `motion.rs` change. ## Self-check **pr_ready** (`tools/pr_ready.py` on debian, against origin/main at 6a065fa48, 5 min 59 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +95 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (17 s) | | clippy | ✅ (1 min 35 s) | | tests: horizon-client | ❌ 1099 passed, 1 failed (4 min 2 s) | | doc tests | ✅ 0 passed (5 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (no vanilla data here): 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) | The one failing test, `packs::cache::tests::zip_content_and_failed_build_invalidate`, fails the same way on `main` at 6a065fa48 on this machine without this change (the archive with an unsupported compression method builds instead of failing, `packs/cache.rs:561`); it doesn't touch anything this PR changes. Not checked in game. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:12:21 +07:00
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#3794
No description provided.