[PR #1137] [MERGED] Ender dragon: runs on server levels, fights every player, vanilla damage rules #3081

Closed
opened 2026-11-02 16:01:22 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/dragon-server-levels


📝 Commits (5)

  • f2f3fb6 fix: the ender dragon fight runs on server levels
  • f568888 fix: dragon damage follows vanilla (perched arrows, cooldown, explosions)
  • ac06314 fix: the dragon fights every player in the End, not only the window's
  • 1845cc7 fix: end crystals take their entity ids when the fight places them
  • 4b4b88b dragon: FightWho's doc names LAN and server players only

📊 Changes

7 files changed (+878 additions, -194 deletions)

View changed files

📝 crates/horizon-client/src/game/control.rs (+1 -1)
📝 crates/horizon-client/src/game/creatures.rs (+20 -2)
📝 crates/horizon-client/src/game/dragon.rs (+685 -184)
📝 crates/horizon-client/src/game/lan_actions.rs (+17 -6)
📝 crates/horizon-client/src/game/lan_entities.rs (+1 -0)
📝 mods/horizon/src/test/java/dev/horizonlab/parity/VanillaProtocolClient.java (+3 -1)
➕ tools/test_server_dragon_parity.py (+151 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

What

Four commits cherry-picked from the companion branch (RESUME §2 9b: 618db927, c730ed9e, 2eef4e4b, e32e5031), plus a doc fix:

  • The fight runs on server levels. On a dedicated server (and single player's server thread) the End ticked with no local player and tick_fight returned before spawning the dragon: players in the End found crystals but never a dragon. The fight now finds its players as EnderDragonFight.updatePlayers does, and the dragon is tracked to network players with its part ids reserved, so clients can attack the parts.
  • It fights every player in the End, not only the window's: targeting through TargetingConditions.forCombat, strafes, charges, wing knockback, bites, breath and fireballs act on LAN guests and server players too.
  • Vanilla damage: a perched dragon shrugs arrows off (AbstractDragonSittingPhase.onHurt), the hurt cooldown lets a stronger hit's excess through, explosions hit the body and each part by exposure, and every crystal in reach blows up.
  • End crystals take their ids when the fight places them, as EndCrystal's constructor does.

The companion's own code (its End route) stays on the companion branch.

Proof

  • tools/test_server_dragon_parity.py (new): a lone vanilla-codec client in the End of vanilla's dedicated server and of Horizon's: the fight starts and the dragon is tracked with the same spawn data, synched data and attributes. Passes on the integration commit.
  • Unit tests in game/dragon.rs: perched arrows, the cooldown's excess, parts' quarter plus one, take-off after a quarter of its health, explosion exposure, targeting rules.

Self-check

All 18 B5 branches merged on one integration commit over origin/main b31cb422 (Mac mini):

cargo fmt --all --check                                                  ok
set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings   exit 0, no ^error
cargo test -p horizon-client                                             1087 passed, 0 failed
python3 tools/parity.py --changed origin/main                            102 passed, 0 failed (over b7390d78)
python3 tools/parity.py --changed-files <explosion.rs>                   22 passed, 0 failed (over b31cb422, after rebasing onto #1101)

tools/lan_e2e.py, full runs over b31cb422 (48 checks):

  • --server-thread: 47 passed; swings (the guest's hoe) failed after earlier checks and passes alone.
  • in-frame: 44 passed. cracks caught a guest's crack left behind when its own tick broke the block (fixed in the cracks PR; swings then cracks and a 3-break probe now pass in both modes). barter (piglin gone), swings and effects fail only after earlier checks and pass alone.
  • sign (not touched here) fails about 1 run in 4, on main too: place reports 2 ticks after the click, sometimes before the server's answer. Noted in FEATURES.md with the other flakes.

🤖 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/1137 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/dragon-server-levels` --- ### 📝 Commits (5) - [`f2f3fb6`](https://github.com/horizon-rust/horizon/commit/f2f3fb6ede37c0431ccead98ee65f54e44e1eb23) fix: the ender dragon fight runs on server levels - [`f568888`](https://github.com/horizon-rust/horizon/commit/f5688883ad3da6cdb755a2cacdd7cfd06ac31330) fix: dragon damage follows vanilla (perched arrows, cooldown, explosions) - [`ac06314`](https://github.com/horizon-rust/horizon/commit/ac06314bd91369df41e03f62ebafe0ccf15af87d) fix: the dragon fights every player in the End, not only the window's - [`1845cc7`](https://github.com/horizon-rust/horizon/commit/1845cc73af5738436a19432ea7fd8458cbd2e27d) fix: end crystals take their entity ids when the fight places them - [`4b4b88b`](https://github.com/horizon-rust/horizon/commit/4b4b88b061d204c646d72264070fc0f554f7e1fd) dragon: FightWho's doc names LAN and server players only ### 📊 Changes **7 files changed** (+878 additions, -194 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/control.rs` (+1 -1) 📝 `crates/horizon-client/src/game/creatures.rs` (+20 -2) 📝 `crates/horizon-client/src/game/dragon.rs` (+685 -184) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+17 -6) 📝 `crates/horizon-client/src/game/lan_entities.rs` (+1 -0) 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaProtocolClient.java` (+3 -1) ➕ `tools/test_server_dragon_parity.py` (+151 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What Four commits cherry-picked from the companion branch (RESUME §2 9b: `618db927`, `c730ed9e`, `2eef4e4b`, `e32e5031`), plus a doc fix: - **The fight runs on server levels.** On a dedicated server (and single player's server thread) the End ticked with no local player and `tick_fight` returned before spawning the dragon: players in the End found crystals but never a dragon. The fight now finds its players as `EnderDragonFight.updatePlayers` does, and the dragon is tracked to network players with its part ids reserved, so clients can attack the parts. - **It fights every player in the End**, not only the window's: targeting through `TargetingConditions.forCombat`, strafes, charges, wing knockback, bites, breath and fireballs act on LAN guests and server players too. - **Vanilla damage:** a perched dragon shrugs arrows off (`AbstractDragonSittingPhase.onHurt`), the hurt cooldown lets a stronger hit's excess through, explosions hit the body and each part by exposure, and every crystal in reach blows up. - **End crystals take their ids when the fight places them**, as `EndCrystal`'s constructor does. The companion's own code (its End route) stays on the companion branch. ## Proof - `tools/test_server_dragon_parity.py` (new): a lone vanilla-codec client in the End of vanilla's dedicated server and of Horizon's: the fight starts and the dragon is tracked with the same spawn data, synched data and attributes. Passes on the integration commit. - Unit tests in `game/dragon.rs`: perched arrows, the cooldown's excess, parts' quarter plus one, take-off after a quarter of its health, explosion exposure, targeting rules. ### Self-check All 18 B5 branches merged on one integration commit over origin/main `b31cb422` (Mac mini): ``` cargo fmt --all --check ok set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings exit 0, no ^error cargo test -p horizon-client 1087 passed, 0 failed python3 tools/parity.py --changed origin/main 102 passed, 0 failed (over b7390d78) python3 tools/parity.py --changed-files <explosion.rs> 22 passed, 0 failed (over b31cb422, after rebasing onto #1101) ``` `tools/lan_e2e.py`, full runs over `b31cb422` (48 checks): - `--server-thread`: 47 passed; `swings` (the guest's hoe) failed after earlier checks and passes alone. - in-frame: 44 passed. `cracks` caught a guest's crack left behind when its own tick broke the block (fixed in the cracks PR; `swings` then `cracks` and a 3-break probe now pass in both modes). `barter` (piglin gone), `swings` and `effects` fail only after earlier checks and pass alone. - `sign` (not touched here) fails about 1 run in 4, on main too: `place` reports 2 ticks after the click, sometimes before the server's answer. Noted in FEATURES.md with the other flakes. 🤖 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-02 16:01:22 +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#3081
No description provided.