[PR #7865] Initialize captains' head drop chance with the ominous banner #7869

Open
opened 2026-11-03 07:25:46 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7865
Author: @TheMrZZ
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/raid-captain-head-drop-chance


📝 Commits (1)

  • db175a3 Initialize captains' head drop chance with the ominous banner

📊 Changes

2 files changed (+142 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/mobs/raider.rs (+16 -2)
📝 tools/lan_e2e.py (+126 -0)

📄 Description

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

What and why

Fixes #7849. Equipping a captain's ominous banner now sets the stored head drop chance to 2.0 through the existing per-slot setter. /data and NBT predicates therefore see drop_chances:{head:2.0f} after a real first raid wave. Other slots' explicit chances are preserved.

The saved-field unit regression fails on old source (head missing) and passes with the fix, retaining an explicit offhand chance and the existing ominous-stack/client checks. The real LAN regression improves 10/12 → 12/12 observations: first-wave captain, ordinary pillager, and explicit chance 2.0 control. All subjects must exist; missing entities are rejected separately from missing fields. The complete captain head stack remains unchanged between the native before/after runs.

The LAN scene waits at least 300 actual ticks for a bed claim, observes a connected player's Bad Omen → Raid Omen appearance and expiry while world time stays frozen, then advances exactly 1+149+150 raid ticks and requires one captain. It uses an elevated loaded village to keep the field checks independent of terrain. Expected field values follow the inspected official 26.3 bytecode.

Scope is initialization and saved fields; no hero, victory/loss, death-drop or reload parity claim.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Official 26.3 Raid.setLeader equips the ominous banner then calls setDropChance(EquipmentSlot.HEAD,2.0f). PatrollingMonster.finalizeSpawn does the same when equipping a leader. Mob.addAdditionalSaveData writes non-default slot chances.

Harness: tools/lan_e2e.py --check raid-captain-fields, using two real native clients and the hosted server; mobs::raider::tests::wear_banner_keeps_the_stack_and_head_drop_chance checks saved NBT and preservation of another slot. Port ledger checked.

Other projects' code

None.

Self-check

pr_ready (tools/pr_ready.py --quick on a local runner, against origin/main at 56afb1c0d, 7 min 26 s)

Check Result
Scope ✅ 2 files, +142 −2
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 614 passed (1 min 36 s)
rustfmt ✅ (6 s)
clippy ✅ (1 min 24 s)
tests: horizon-client-lib ✅ 1479 passed (4 min 18 s)
doc tests ✅ 0 passed (2 s)
content root tests ➖ content root untouched
mod API up to date ➖ native hooks untouched
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/7865 **Author:** [@TheMrZZ](https://github.com/TheMrZZ) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/raid-captain-head-drop-chance` --- ### 📝 Commits (1) - [`db175a3`](https://github.com/horizon-rust/horizon/commit/db175a315a51621fd2a13ff741762bd73e4c16bb) Initialize captains' head drop chance with the ominous banner ### 📊 Changes **2 files changed** (+142 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/raider.rs` (+16 -2) 📝 `tools/lan_e2e.py` (+126 -0) </details> ### 📄 Description > 🤖 Opened by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally. ## What and why Fixes #7849. Equipping a captain's ominous banner now sets the stored head drop chance to 2.0 through the existing per-slot setter. `/data` and NBT predicates therefore see `drop_chances:{head:2.0f}` after a real first raid wave. Other slots' explicit chances are preserved. The saved-field unit regression fails on old source (`head` missing) and passes with the fix, retaining an explicit offhand chance and the existing ominous-stack/client checks. The real LAN regression improves **10/12 → 12/12** observations: first-wave captain, ordinary pillager, and explicit chance 2.0 control. All subjects must exist; missing entities are rejected separately from missing fields. The complete captain head stack remains unchanged between the native before/after runs. The LAN scene waits at least 300 actual ticks for a bed claim, observes a connected player's Bad Omen → Raid Omen appearance and expiry while world time stays frozen, then advances exactly 1+149+150 raid ticks and requires one captain. It uses an elevated loaded village to keep the field checks independent of terrain. Expected field values follow the inspected official 26.3 bytecode. Scope is initialization and saved fields; no hero, victory/loss, death-drop or reload parity claim. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Official 26.3 `Raid.setLeader` equips the ominous banner then calls `setDropChance(EquipmentSlot.HEAD,2.0f)`. `PatrollingMonster.finalizeSpawn` does the same when equipping a leader. `Mob.addAdditionalSaveData` writes non-default slot chances. Harness: `tools/lan_e2e.py --check raid-captain-fields`, using two real native clients and the hosted server; `mobs::raider::tests::wear_banner_keeps_the_stack_and_head_drop_chance` checks saved NBT and preservation of another slot. Port ledger checked. ## Other projects' code None. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on a local runner, against origin/main at 56afb1c0d, 7 min 26 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +142 −2 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 614 passed (1 min 36 s) | | rustfmt | ✅ (6 s) | | clippy | ✅ (1 min 24 s) | | tests: horizon-client-lib | ✅ 1479 passed (4 min 18 s) | | doc tests | ✅ 0 passed (2 s) | | content root tests | ➖ content root untouched | | mod API up to date | ➖ native hooks untouched | | 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>
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#7869
No description provided.