[PR #5059] [MERGED] Lift an experience orb out of the block it spawned in #6030

Closed
opened 2026-11-03 05:16:45 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/xp-orb-unstuck


📝 Commits (7)

  • 23b8c8d Lift an experience orb out of the block it spawned in
  • 22ea093 Fold the two expressions rustfmt wants on one line
  • 9cef07d Drop the orb scan's unused upper-corner binding
  • a405d45 ExperienceOrb.unstuckIfPossible: search a cube of the orb's size around its centre
  • fc0645c Merge origin/main (picks up #5251's compile fixes)
  • 5108719 Merge origin/main into xp orb unstuck
  • 21569d4 Merge origin/main (picks up 72fabfede's Python test fix)

📊 Changes

4 files changed (+123 additions, -12 deletions)

View changed files

📝 crates/horizon-client/src/entities.rs (+104 -9)
📝 crates/horizon-client/src/game.rs (+13 -0)
📝 crates/horizon-client/src/game/commands.rs (+5 -2)
📝 crates/horizon-client/src/game/nether_portal.rs (+1 -1)

📄 Description

Fixes the ExperienceOrb.unstuckIfPossible row in the port ledger. (No issue.)

Vanilla's orb constructor ends with if (!level.noCollision(getBoundingBox())) unstuckIfPossible(size), where the size is the box's mean dimension, and unstuckIfPossible searches a cube of that size around the orb's centre for the nearest free position. So an orb spawned inside a block — XP from a mob killed in a 1×1 hole, or from a block broken against a wall — is lifted out and can be collected. Horizon placed orbs with no collision test at both spawn sites and the tick only resolves movement out of a box it already overlaps, so a buried orb stayed buried and could never be picked up.

Proven: the new test passes on a build box and the whole horizon-client lib suite passes with it (940 passed): an orb whose box intersects a block ends with a collision-free box, and one spawned in open air keeps its exact position.

Not proven: nothing in a game, and no harness — the check is to dig a one-block hole, stand in it, kill a mob, and see the orbs come out of the floor.


🔄 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/5059 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/xp-orb-unstuck` --- ### 📝 Commits (7) - [`23b8c8d`](https://github.com/horizon-rust/horizon/commit/23b8c8de7ab00f250e6e44bc04482f59aaf58428) Lift an experience orb out of the block it spawned in - [`22ea093`](https://github.com/horizon-rust/horizon/commit/22ea093e7660f8f1f0505fa9f16ba20333a7b63e) Fold the two expressions rustfmt wants on one line - [`9cef07d`](https://github.com/horizon-rust/horizon/commit/9cef07df2f808a61f0db4d8f96f90f2dff49f3ac) Drop the orb scan's unused upper-corner binding - [`a405d45`](https://github.com/horizon-rust/horizon/commit/a405d45b3cacd8505de6cc68751c6c040fc433fe) ExperienceOrb.unstuckIfPossible: search a cube of the orb's size around its centre - [`fc0645c`](https://github.com/horizon-rust/horizon/commit/fc0645c6bee0bab59040cd7b1c71befd095fe592) Merge origin/main (picks up #5251's compile fixes) - [`5108719`](https://github.com/horizon-rust/horizon/commit/5108719261d4c3bc92b07cad026370b81297bd54) Merge origin/main into xp orb unstuck - [`21569d4`](https://github.com/horizon-rust/horizon/commit/21569d4a8df39544b36c6699d2680f674fa65b9d) Merge origin/main (picks up 72fabfede's Python test fix) ### 📊 Changes **4 files changed** (+123 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entities.rs` (+104 -9) 📝 `crates/horizon-client/src/game.rs` (+13 -0) 📝 `crates/horizon-client/src/game/commands.rs` (+5 -2) 📝 `crates/horizon-client/src/game/nether_portal.rs` (+1 -1) </details> ### 📄 Description Fixes the `ExperienceOrb.unstuckIfPossible` row in the port ledger. (No issue.) Vanilla's orb constructor ends with `if (!level.noCollision(getBoundingBox())) unstuckIfPossible(size)`, where the size is the box's mean dimension, and `unstuckIfPossible` searches a cube of that size around the orb's centre for the nearest free position. So an orb spawned inside a block — XP from a mob killed in a 1×1 hole, or from a block broken against a wall — is lifted out and can be collected. Horizon placed orbs with no collision test at both spawn sites and the tick only resolves movement out of a box it already overlaps, so a buried orb stayed buried and could never be picked up. **Proven:** the new test passes on a build box and the whole `horizon-client` lib suite passes with it (940 passed): an orb whose box intersects a block ends with a collision-free box, and one spawned in open air keeps its exact position. **Not proven:** nothing in a game, and no harness — the check is to dig a one-block hole, stand in it, kill a mob, and see the orbs come out of the floor. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:16:45 +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#6030
No description provided.