[PR #5601] [MERGED] An experience orb falls and lands as vanilla does #6380

Closed
opened 2026-11-03 06:19:34 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5601
Author: @JustKarkat
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/dragon-xp-orb-float


📝 Commits (2)

  • 1703b9f An experience orb falls and lands as vanilla does (#4781)
  • e3c5efc Experience orbs: the push out of a block is the server's; one moveTowardsClosestSpace

📊 Changes

4 files changed (+156 additions, -54 deletions)

View changed files

📝 crates/horizon-client/src/entities.rs (+124 -53)
📝 crates/horizon-client/src/game.rs (+1 -0)
📝 crates/horizon-client/src/game/remote.rs (+1 -1)
📝 tools/command_exec_corpus.py (+30 -0)

📄 Description

🤖 Opened by JustKarkat's AI agent (ZCode), not by JustKarkat personally.

Fixes #4781.

The report

After the dragon dies, its XP rain "descends extremely slowly and seems to float in mid-air for several seconds" and spreads out oddly. ExperienceOrb.tick diverged from vanilla 26.3 in exactly the way that shows: a landing orb kept its pre-collision speed through the friction step and bounced back at * -0.9 of it on every ground contact — a terminal-velocity landing (-1.47/tick) rebounded to +1.30 and decayed slowly, so the orbs hopped over the exit portal for a long time.

The port (vanilla 26.3 ExperienceOrb.tick)

  • Landing bounce: if (verticalCollisionBelow && fallSpeed < -getGravity()) setDeltaMovement(..., -fallSpeed * 0.4, ...) — 0.4 of the pre-move speed, gated on actually falling faster than gravity — instead of a fixed -0.9 restitution.
  • Entity.move's restituteMovementAfterCollisions for a bounciness-0 orb: each collided axis's velocity is zeroed (x and z by Mth.equal's 1.0E-5, y exactly). A settled orb now rests at exactly Motion: [0.0, 0.0, 0.0] like vanilla's, instead of carrying a residual.
  • One friction for every axis: getAirDrag() (0.98F) with the ground's block friction multiplied in as a float, scaled over x, y and z — the y drag is no longer hardcoded 0.98 on the ground.
  • Gravity is skipped while the orb's box is inside blocks (!level.noCollision), and a stuck orb with no player within 8 blocks gets Entity.moveTowardsClosestSpace (the method already ported for items, now on the orb too, its own random drawing the speed).
  • The friction anchor below the orb is getOnPos(0.999999) as the item's port already was, not the block one below.

Test

tools/test_command_exec_parity.py gains an "experience orb fall" group: an orb summoned 45 blocks above a stone platform, 16 blocks from the player so the 8-block follow radius never pulls it, observed through data get at spawn, mid-fall, just after landing, mid-decay and settled. Vanilla and Horizon agree to the digit at every checkpoint — 969/969 commands match with the group in (the corpus was 959/959 before it).

pr_ready on this branch:

| Python tests | ✅ 510 passed (25 s) |
| rustfmt | ✅ (5 s) |
| clippy | ✅ (1 min 10 s) |
| tests: horizon-client | ✅ 1576 passed (3 min 49 s) |
| Parity | 53 affected, 49 passed |

The three parity rows that fail — dedicated_server, friends_integration, online_mode — fail on untouched origin/main the same way (I reran all three detached at 23cd6895b before restoring the branch): dedicated_server diffs 2 lines of the config-phase registry_data dialog packet, online_mode dies in the harness's own Python (test_online_mode_parity.py:310 IndexError: tuple index out of range), and friends_integration times out waiting for the host world (chunks: 0). None touches orbs; they look like a main-side harness/tooling drift to file separately.


🔄 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/5601 **Author:** [@JustKarkat](https://github.com/JustKarkat) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/dragon-xp-orb-float` --- ### 📝 Commits (2) - [`1703b9f`](https://github.com/horizon-rust/horizon/commit/1703b9f78fa4ede59750261663d4a658e9ad0a33) An experience orb falls and lands as vanilla does (#4781) - [`e3c5efc`](https://github.com/horizon-rust/horizon/commit/e3c5efcc774ab3db059ff99c5a9a3d994acb7575) Experience orbs: the push out of a block is the server's; one moveTowardsClosestSpace ### 📊 Changes **4 files changed** (+156 additions, -54 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entities.rs` (+124 -53) 📝 `crates/horizon-client/src/game.rs` (+1 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+1 -1) 📝 `tools/command_exec_corpus.py` (+30 -0) </details> ### 📄 Description > 🤖 Opened by JustKarkat's AI agent (ZCode), not by JustKarkat personally. Fixes #4781. ## The report After the dragon dies, its XP rain "descends extremely slowly and seems to float in mid-air for several seconds" and spreads out oddly. `ExperienceOrb.tick` diverged from vanilla 26.3 in exactly the way that shows: a landing orb kept its pre-collision speed through the friction step and bounced back at `* -0.9` of it on **every** ground contact — a terminal-velocity landing (-1.47/tick) rebounded to +1.30 and decayed slowly, so the orbs hopped over the exit portal for a long time. ## The port (vanilla 26.3 `ExperienceOrb.tick`) - **Landing bounce**: `if (verticalCollisionBelow && fallSpeed < -getGravity()) setDeltaMovement(..., -fallSpeed * 0.4, ...)` — 0.4 of the pre-move speed, gated on actually falling faster than gravity — instead of a fixed `-0.9` restitution. - **`Entity.move`'s `restituteMovementAfterCollisions`** for a bounciness-0 orb: each collided axis's velocity is zeroed (x and z by `Mth.equal`'s 1.0E-5, y exactly). A settled orb now rests at exactly `Motion: [0.0, 0.0, 0.0]` like vanilla's, instead of carrying a residual. - **One friction for every axis**: `getAirDrag()` (0.98F) with the ground's block friction multiplied in as a float, scaled over x, y and z — the y drag is no longer hardcoded 0.98 on the ground. - **Gravity is skipped while the orb's box is inside blocks** (`!level.noCollision`), and a stuck orb with no player within 8 blocks gets `Entity.moveTowardsClosestSpace` (the method already ported for items, now on the orb too, its own random drawing the speed). - The friction anchor below the orb is `getOnPos(0.999999)` as the item's port already was, not the block one below. ## Test `tools/test_command_exec_parity.py` gains an **"experience orb fall"** group: an orb summoned 45 blocks above a stone platform, 16 blocks from the player so the 8-block follow radius never pulls it, observed through `data get` at spawn, mid-fall, just after landing, mid-decay and settled. Vanilla and Horizon agree **to the digit at every checkpoint** — 969/969 commands match with the group in (the corpus was 959/959 before it). pr_ready on this branch: | Python tests | ✅ 510 passed (25 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ (1 min 10 s) | | tests: horizon-client | ✅ 1576 passed (3 min 49 s) | | Parity | 53 affected, 49 passed | The three parity rows that fail — `dedicated_server`, `friends_integration`, `online_mode` — fail **on untouched `origin/main` the same way** (I reran all three detached at 23cd6895b before restoring the branch): `dedicated_server` diffs 2 lines of the config-phase `registry_data` dialog packet, `online_mode` dies in the harness's own Python (`test_online_mode_parity.py:310 IndexError: tuple index out of range`), and `friends_integration` times out waiting for the host world (`chunks: 0`). None touches orbs; they look like a main-side harness/tooling drift to file separately. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:19:34 +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#6380
No description provided.