[PR #2049] [MERGED] The server thread's client draws the Ender Dragon #3966

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

📋 Pull Request Information

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

Base: main ← Head: fix/remote-ender-dragon


📝 Commits (1)

  • 955b6c2 The server thread's client draws the Ender Dragon

📊 Changes

4 files changed (+228 additions, -19 deletions)

View changed files

📝 crates/horizon-client/src/game/dragon.rs (+201 -19)
📝 crates/horizon-client/src/game/remote.rs (+23 -0)
📝 crates/horizon-client/src/game/remote_projectiles.rs (+2 -0)
📝 crates/horizon-client/src/game/remote_vehicles.rs (+2 -0)

📄 Description

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

What and why

Fixes #1530.

On the server thread, the End's natural Ender Dragon was invisible: the client tracked
minecraft:ender_dragon but never built its state. remote.rs's spawn_entity only creates
mobs from mob_types(), which has no dragon, and dragon_geometry draws Game::dragon. End
crystals already had their own remote constructor (spawn_remote_projectile); the dragon had none.

The client now keeps the server's dragon in Game::dragon (game/dragon.rs, "The dragon on a
server's client"):

  • handleAddEntity: spawn_remote_dragon builds it at the packet's position and yaw, with its
    id, full health and the hovering phase (the client-side constructor's state).
  • handleSetEntityData: DATA_HEALTH_ID (9) and DATA_PHASE (16, onSyncedDataUpdated sets
    the phase).
  • handleSetEntityMotion: its velocity, which drives the wing speed.
  • Moves: LivingEntity's interpolation, through the same Lerp as other entities
    (position and yaw, stepped in tick_remote).
  • tick_remote_dragon, the client side of EnderDragon.aiStep: processFlappingMovement and
    onFlap (flap sound), the growl, checkCrystals' nearest-crystal search (the healing beam),
    the flight history and the part positions. A dead dragon rises and bursts as in tickDeath;
    the server removes it.
  • handleHurtAnimation / handleDamageEvent: the red flash.
  • handleRemoveEntities and leaving the level drop it; a removed crystal keeps the beam's index
    right.
  • Attacking: remote_object_hit now picks the dragon's parts (EnderDragonPart.isPickable) and
    sends Attack with the part's id (the dragon's id + 1..8), which the server already resolves
    (tracked_special_box).

The in-frame fight is unchanged; its nearest-crystal search moved into nearest_crystal_to,
shared with the client.

Checked in game

Fresh creative world, execute in minecraft:the_end run tp @s 0.5 100 0.5, render distance 6:

  • Server thread: the dragon draws (boss bar, a crystal's healing beam on it), and its client
    position follows the server's (6 reads, 5 s apart). Health 200, phase 0, 10 crystals.
  • --in-frame: the same scene looks the same.
  • Server thread: chasing it and attacking lowered its health on the server three times
    (200 → 199.625 …), and the client got the new value.

Not checked: the death animation on the server thread, since /kill @e[type=ender_dragon] finds
no entity there (#1531).

Self-check

pr_ready (tools/pr_ready.py on debian, against origin/main at 8cf51888c, 45 min 17 s)

Check Result
Scope ✅ 4 files, +228 −19
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (15 s)
clippy ✅ (1 min 10 s)
tests: horizon-client ✅ 1292 passed (11 min 41 s)
doc tests ✅ 0 passed (7 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ✅ 5 affected, 5 passed (31 min 58 s)
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 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/2049 **Author:** [@vlesmentie](https://github.com/vlesmentie) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/remote-ender-dragon` --- ### 📝 Commits (1) - [`955b6c2`](https://github.com/horizon-rust/horizon/commit/955b6c2134594d63210aeeff75168852b85bd967) The server thread's client draws the Ender Dragon ### 📊 Changes **4 files changed** (+228 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/dragon.rs` (+201 -19) 📝 `crates/horizon-client/src/game/remote.rs` (+23 -0) 📝 `crates/horizon-client/src/game/remote_projectiles.rs` (+2 -0) 📝 `crates/horizon-client/src/game/remote_vehicles.rs` (+2 -0) </details> ### 📄 Description > 🤖 Opened by vlesmentie's AI agent (Claude Code, Claude Opus 5.5), not by vlesmentie themselves. ## What and why Fixes #1530. On the server thread, the End's natural Ender Dragon was invisible: the client tracked `minecraft:ender_dragon` but never built its state. `remote.rs`'s `spawn_entity` only creates mobs from `mob_types()`, which has no dragon, and `dragon_geometry` draws `Game::dragon`. End crystals already had their own remote constructor (`spawn_remote_projectile`); the dragon had none. The client now keeps the server's dragon in `Game::dragon` (`game/dragon.rs`, "The dragon on a server's client"): - `handleAddEntity`: `spawn_remote_dragon` builds it at the packet's position and yaw, with its id, full health and the hovering phase (the client-side constructor's state). - `handleSetEntityData`: `DATA_HEALTH_ID` (9) and `DATA_PHASE` (16, `onSyncedDataUpdated` sets the phase). - `handleSetEntityMotion`: its velocity, which drives the wing speed. - Moves: LivingEntity's interpolation, through the same `Lerp` as other entities (position and yaw, stepped in `tick_remote`). - `tick_remote_dragon`, the client side of `EnderDragon.aiStep`: `processFlappingMovement` and `onFlap` (flap sound), the growl, `checkCrystals`' nearest-crystal search (the healing beam), the flight history and the part positions. A dead dragon rises and bursts as in `tickDeath`; the server removes it. - `handleHurtAnimation` / `handleDamageEvent`: the red flash. - `handleRemoveEntities` and leaving the level drop it; a removed crystal keeps the beam's index right. - Attacking: `remote_object_hit` now picks the dragon's parts (`EnderDragonPart.isPickable`) and sends `Attack` with the part's id (the dragon's id + 1..8), which the server already resolves (`tracked_special_box`). The in-frame fight is unchanged; its nearest-crystal search moved into `nearest_crystal_to`, shared with the client. ## Checked in game Fresh creative world, `execute in minecraft:the_end run tp @s 0.5 100 0.5`, render distance 6: - Server thread: the dragon draws (boss bar, a crystal's healing beam on it), and its client position follows the server's (6 reads, 5 s apart). Health 200, phase 0, 10 crystals. - `--in-frame`: the same scene looks the same. - Server thread: chasing it and attacking lowered its health on the server three times (200 → 199.625 …), and the client got the new value. Not checked: the death animation on the server thread, since `/kill @e[type=ender_dragon]` finds no entity there (#1531). ## Self-check **pr_ready** (`tools/pr_ready.py` on debian, against origin/main at 8cf51888c, 45 min 17 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +228 −19 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (15 s) | | clippy | ✅ (1 min 10 s) | | tests: horizon-client | ✅ 1292 passed (11 min 41 s) | | doc tests | ✅ 0 passed (7 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ✅ 5 affected, 5 passed (31 min 58 s) | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 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:13:38 +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#3966
No description provided.