[PR #7481] [MERGED] List custom bossbars in Java HashMap order #7622

Closed
opened 2026-11-03 07:21:02 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7481
Author: @TheMrZZ
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: fix/bossbar-list-order


📝 Commits (2)

📊 Changes

2 files changed (+146 additions, -6 deletions)

View changed files

📝 crates/horizon-client/src/game/bossbars.rs (+120 -6)
📝 tools/command_exec_corpus.py (+26 -0)

📄 Description

🤖 Opened by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally.

What and why

bossbar list now traverses the default Java HashMap order. Adding audit:test, renaming it to Other, then adding audit:second now lists [Second], [Other], with the same result count of two.

A reply-only tracker uses the existing JavaHashMap and Identifier implementations. Adds and removals update that tracker, retaining resize/removal history through the session. Tracking is rebuilt from the loaded store. List entries reference the current bars, so renaming does not leave cached names behind.

The existing bossbar store, packet publication, and saved format remain in use. This change does not claim packet or persistence parity.

Fixes #7469.

Kind

  • parity: Horizon now does what vanilla 26.3 does

Vanilla reference

Official Java 26.3 CustomBossEvents constructs its events map through Guava Maps.newHashMap(), which uses a no-argument java.util.HashMap. getEvents returns its values. BossBarCommands.listBars formats that collection without sorting. Identifier.hashCode is 31*namespace.hashCode()+path.hashCode(), with Java int wrapping; comparison is path-first, then namespace. The existing reusable Rust types implement these semantics.

Other projects' code

None.

Self-check

Three focused gameplay tests cover the supplied two-bar order and updated name, tracking after load, and map growth/removal history. After growth from 16 to 32 buckets, the same two IDs reverse order, and removing/re-adding them retains the larger table.

The command-execution corpus adds two-bar lists, rename, growth, removal, re-addition, and empty-list cleanup. Full native command runtime parity requires prepared game data and remains unrun locally.

pr_ready (tools/pr_ready.py --quick on a local runner, against origin/main at f696adc89, 2 min 46 s)

Check Result
Scope ✅ 2 files, +146 −6
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 614 passed (40 s)
rustfmt ✅ (5 s)
clippy ✅ (1 min 17 s)
tests: horizon-client ✅ 697 passed (32 s)
doc tests ✅ 0 passed (2 s)
content root tests ➖ content root untouched
mod API up to date ✅ (10 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Codex.


🔄 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/7481 **Author:** [@TheMrZZ](https://github.com/TheMrZZ) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/bossbar-list-order` --- ### 📝 Commits (2) - [`c54a594`](https://github.com/horizon-rust/horizon/commit/c54a594be1cf789c9e8c36866d7f6be8b8c94fd5) List custom bossbars in Java HashMap order - [`1dfb29c`](https://github.com/horizon-rust/horizon/commit/1dfb29c7f08a7aa5bcc583f79fb88f8ecae27065) Merge main into #7481 ### 📊 Changes **2 files changed** (+146 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/bossbars.rs` (+120 -6) 📝 `tools/command_exec_corpus.py` (+26 -0) </details> ### 📄 Description > 🤖 Opened by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally. ## What and why `bossbar list` now traverses the default Java HashMap order. Adding `audit:test`, renaming it to `Other`, then adding `audit:second` now lists `[Second], [Other]`, with the same result count of two. A reply-only tracker uses the existing JavaHashMap and Identifier implementations. Adds and removals update that tracker, retaining resize/removal history through the session. Tracking is rebuilt from the loaded store. List entries reference the current bars, so renaming does not leave cached names behind. The existing bossbar store, packet publication, and saved format remain in use. This change does not claim packet or persistence parity. Fixes #7469. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does ## Vanilla reference Official Java 26.3 `CustomBossEvents` constructs its events map through Guava `Maps.newHashMap()`, which uses a no-argument `java.util.HashMap`. `getEvents` returns its values. `BossBarCommands.listBars` formats that collection without sorting. `Identifier.hashCode` is `31*namespace.hashCode()+path.hashCode()`, with Java int wrapping; comparison is path-first, then namespace. The existing reusable Rust types implement these semantics. ## Other projects' code None. ## Self-check Three focused gameplay tests cover the supplied two-bar order and updated name, tracking after load, and map growth/removal history. After growth from 16 to 32 buckets, the same two IDs reverse order, and removing/re-adding them retains the larger table. The command-execution corpus adds two-bar lists, rename, growth, removal, re-addition, and empty-list cleanup. Full native command runtime parity requires prepared game data and remains unrun locally. **pr_ready** (`tools/pr_ready.py --quick` on a local runner, against origin/main at f696adc89, 2 min 46 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +146 −6 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 614 passed (40 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ (1 min 17 s) | | tests: horizon-client | ✅ 697 passed (32 s) | | doc tests | ✅ 0 passed (2 s) | | content root tests | ➖ content root untouched | | mod API up to date | ✅ (10 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Codex](https://openai.com/codex/). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 07:21:02 +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#7622
No description provided.