[PR #724] [MERGED] Guests: experience orbs fly to them and give them their points #2758

Closed
opened 2026-11-02 15:58:49 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/guest-experience-orbs


📝 Commits (1)

  • d1d36f4 Guests: experience orbs fly to them and give them their points

📊 Changes

10 files changed (+254 additions, -40 deletions)

View changed files

📝 crates/horizon-client/src/entities.rs (+2 -0)
📝 crates/horizon-client/src/entity_nbt.rs (+2 -0)
📝 crates/horizon-client/src/game.rs (+57 -21)
📝 crates/horizon-client/src/game/commands.rs (+2 -0)
📝 crates/horizon-client/src/game/lan.rs (+18 -1)
📝 crates/horizon-client/src/game/lan_actions.rs (+77 -1)
📝 crates/horizon-client/src/game/persist.rs (+7 -1)
📝 crates/horizon-client/src/game/pickups.rs (+1 -0)
📝 crates/horizon-client/src/game/remote.rs (+56 -14)
📝 tools/lan_e2e.py (+32 -2)

📄 Description

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

Fixes #696 (part): Experience, guests receive no XP.

Cause

  • Orbs followed and were taken only by the host's own player.
  • Orbs were never tracked to guests, so guests didn't even see them.

Fix

This follows vanilla ExperienceOrb:

  • Orbs get entity ids and are sent to guests as minecraft:experience_orb, with their value (DATA_VALUE, entity data 8).
  • followNearbyPlayer picks the nearest player within 8 blocks, host or guest (alive, placed, not a spectator).
  • A guest takes an orb when its box grown by (1, 0.5, 1) touches it: one random orb per touch, with takeXpDelay 2, Mending first (repairPlayerItems), then the points and the level-up sound. The pickup animation flies toward the guest.
  • Server clients draw orbs, update their value from entity data, and show the pickup particle when TakeItemEntity names an orb.

Tests

New lan_e2e.py --check xp: three 7-point orbs 4 blocks from the guest fly to it. The guest sees 3 orbs and ends with 21 points (level 2); the host stays at 0; no orb is left on the guest's screen.

  • Before: FAIL.
  • After: PASS.

Self-check

These ran on one integration commit holding the six #696 branches (#722 to #727), plus a per-branch check:

  • cargo fmt --all --check: ok on each branch.
  • cargo clippy --workspace --all-targets -- -D warnings: ok on the integration commit. cargo clippy -p horizon-client --all-targets -- -D warnings: ok on this branch alone.
  • cargo test -p horizon-client --lib: 823 passed, 0 failed, 11 ignored (integration commit).
  • tools/lan_e2e.py on the integration commit: tab, self, armour, nametags, walls, chest, crafting, damage, mobs, pvp, containers, feedback, trials, clicks, xp, sleep, push and eat all PASS.
    • hazards passes, but it leaves the guest dying in the void, so every check after it fails on the dead screen. The same happens on main, so it was run on its own.
  • Local parity (PARITY_LOCAL_JOBS=3 tools/parity.py --changed origin/main, 88 harnesses): 88 passed, 0 failed (137 min).

Overlaps

  • The open PRs #695, #697 and #700 also touch game/lan_actions.rs, lan/hub.rs, lan/guest.rs, lan/playerdata.rs and tools/lan_e2e.py; #708 touches game/remote.rs and tools/lan_e2e.py.
  • The six #696 PRs each add a check to tools/lan_e2e.py's CHECKS list, and some share game/remote.rs. Whichever merges second needs a small rebase.
  • The recipe book from #696 is #714 (perf-ticks-5), not here.

🤖 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/724 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/17/2026 **Status:** ✅ Merged **Merged:** 10/18/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/guest-experience-orbs` --- ### 📝 Commits (1) - [`d1d36f4`](https://github.com/horizon-rust/horizon/commit/d1d36f4121bd8eb1a4d3d95b7072420cf3ef6d65) Guests: experience orbs fly to them and give them their points ### 📊 Changes **10 files changed** (+254 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entities.rs` (+2 -0) 📝 `crates/horizon-client/src/entity_nbt.rs` (+2 -0) 📝 `crates/horizon-client/src/game.rs` (+57 -21) 📝 `crates/horizon-client/src/game/commands.rs` (+2 -0) 📝 `crates/horizon-client/src/game/lan.rs` (+18 -1) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+77 -1) 📝 `crates/horizon-client/src/game/persist.rs` (+7 -1) 📝 `crates/horizon-client/src/game/pickups.rs` (+1 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+56 -14) 📝 `tools/lan_e2e.py` (+32 -2) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes #696 (part): **Experience**, guests receive no XP. ## Cause - Orbs followed and were taken only by the host's own player. - Orbs were never tracked to guests, so guests didn't even see them. ## Fix This follows vanilla `ExperienceOrb`: - Orbs get entity ids and are sent to guests as `minecraft:experience_orb`, with their value (`DATA_VALUE`, entity data 8). - `followNearbyPlayer` picks the nearest player within 8 blocks, host or guest (alive, placed, not a spectator). - A guest takes an orb when its box grown by (1, 0.5, 1) touches it: one random orb per touch, with `takeXpDelay` 2, Mending first (`repairPlayerItems`), then the points and the level-up sound. The pickup animation flies toward the guest. - Server clients draw orbs, update their value from entity data, and show the pickup particle when `TakeItemEntity` names an orb. ## Tests New `lan_e2e.py --check xp`: three 7-point orbs 4 blocks from the guest fly to it. The guest sees 3 orbs and ends with 21 points (level 2); the host stays at 0; no orb is left on the guest's screen. - Before: FAIL. - After: PASS. ## Self-check These ran on one integration commit holding the six #696 branches (#722 to #727), plus a per-branch check: - `cargo fmt --all --check`: ok on each branch. - `cargo clippy --workspace --all-targets -- -D warnings`: ok on the integration commit. `cargo clippy -p horizon-client --all-targets -- -D warnings`: ok on this branch alone. - `cargo test -p horizon-client --lib`: 823 passed, 0 failed, 11 ignored (integration commit). - `tools/lan_e2e.py` on the integration commit: tab, self, armour, nametags, walls, chest, crafting, damage, mobs, pvp, containers, feedback, trials, clicks, xp, sleep, push and eat all PASS. - `hazards` passes, but it leaves the guest dying in the void, so every check after it fails on the dead screen. The same happens on main, so it was run on its own. - Local parity (`PARITY_LOCAL_JOBS=3 tools/parity.py --changed origin/main`, 88 harnesses): 88 passed, 0 failed (137 min). ## Overlaps - The open PRs #695, #697 and #700 also touch `game/lan_actions.rs`, `lan/hub.rs`, `lan/guest.rs`, `lan/playerdata.rs` and `tools/lan_e2e.py`; #708 touches `game/remote.rs` and `tools/lan_e2e.py`. - The six #696 PRs each add a check to `tools/lan_e2e.py`'s `CHECKS` list, and some share `game/remote.rs`. Whichever merges second needs a small rebase. - The recipe book from #696 is #714 (perf-ticks-5), not here. 🤖 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 15:58:49 +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#2758
No description provided.