[PR #4518] [MERGED] Copper golems open the doors on their path (InteractWithDoor) #5671

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4518
Author: @xFedeT
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @rdbtCVS

Base: main ← Head: fix/copper-golem-doors


📝 Commits (1)

  • c96733f Copper golems open the doors on their path (InteractWithDoor)

📊 Changes

3 files changed (+140 additions, -6 deletions)

View changed files

📝 crates/horizon-client/examples/probe/mob_ai_probe.rs (+20 -2)
📝 crates/horizon-client/src/mobs/animal_brain.rs (+119 -3)
📝 tools/port_map/game-008.tsv (+1 -1)

📄 Description

🤖 Opened by xFedeT's AI agent (Claude Code, Claude Sonnet 5.5), not by xFedeT personally.

Refs #3521

What and why

Row InteractWithDoor.create: only the villager brain opens doors on its path; copper golems and piglins never do. CopperGolemAi puts InteractWithDoor.create() in its core activity at priority 3 (after the walk target sink, before the cooldown counters): each tick it looks at the path's previous and next nodes, opens a door that is one of them, remembers it in DOORS_TO_CLOSE, and closes the remembered doors it has left within 3 blocks. The golem's brain had none, so a golem whose way between a copper chest and a chest ran through a closed wooden door never got through.

New B::InteractWithDoor in animal_brain.rs (same logic as the villager brain's: the 20 tick cooldown on the same next node, the door being left remembered even when open, the one ahead only when this mob opens it), the doors_to_close memory (shown by the probe like vanilla's) and its place in the copper golem's package. The mob_ai probe now plays the sound of a door a mob opens or closes (block.wooden_door.open/close, pitch from the level random), as DoorBlock.setOpen does.

Proof against vanilla's Java

Two scenarios in the mob_ai oracle, not kept in the harness (see below): a wall with a closed oak door between a copper chest holding 20 cobblestone and a chest, the golem on either side. At tick 700, the destination chest:

  • before this change: the golem never got through; the destination chest is empty (7,-60,0 - 0);
  • with this change, and in vanilla: all 20 cobblestone are in the destination chest, and the door's open sound is played at the same tick with the same pitch (3f696536).

The whole harness still matches: 209/209 scenarios, 61114/61114 mob-ticks (a copper golem's brain changed).

Not tick for tick yet

The two door scenarios diverge by one step at tick 115 to 119, so they are not added to the harness (they would fail CI). In vanilla the door opening calls ServerLevel.sendBlockUpdated, which makes every mob whose path is near recompute it at once (PathNavigation.shouldRecomputePath, the row of that name), before the same tick's movement; Horizon does not recompute on a block change, so the golem keeps its 9 node path one tick longer than vanilla's new 6 node one. That belongs to the shouldRecomputePath row, which is next. Also left out: a golem does not look for another golem coming through the door (areOtherMobsComingThroughDoor), and piglins (the probe has no piglin brain).

pr_ready --quick: fmt, clippy, 1064 tests and 481 python tests pass.

🤖 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/4518 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/copper-golem-doors` --- ### 📝 Commits (1) - [`c96733f`](https://github.com/horizon-rust/horizon/commit/c96733f3c6e3bb55372fbe45125b1532d25a0a79) Copper golems open the doors on their path (InteractWithDoor) ### 📊 Changes **3 files changed** (+140 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/probe/mob_ai_probe.rs` (+20 -2) 📝 `crates/horizon-client/src/mobs/animal_brain.rs` (+119 -3) 📝 `tools/port_map/game-008.tsv` (+1 -1) </details> ### 📄 Description > 🤖 Opened by xFedeT's AI agent (Claude Code, Claude Sonnet 5.5), not by xFedeT personally. Refs #3521 ## What and why Row `InteractWithDoor.create`: only the villager brain opens doors on its path; copper golems and piglins never do. `CopperGolemAi` puts `InteractWithDoor.create()` in its core activity at priority 3 (after the walk target sink, before the cooldown counters): each tick it looks at the path's previous and next nodes, opens a door that is one of them, remembers it in `DOORS_TO_CLOSE`, and closes the remembered doors it has left within 3 blocks. The golem's brain had none, so a golem whose way between a copper chest and a chest ran through a closed wooden door never got through. New `B::InteractWithDoor` in `animal_brain.rs` (same logic as the villager brain's: the 20 tick cooldown on the same next node, the door being left remembered even when open, the one ahead only when this mob opens it), the `doors_to_close` memory (shown by the probe like vanilla's) and its place in the copper golem's package. The mob_ai probe now plays the sound of a door a mob opens or closes (`block.wooden_door.open`/`close`, pitch from the level random), as `DoorBlock.setOpen` does. ## Proof against vanilla's Java Two scenarios in the `mob_ai` oracle, not kept in the harness (see below): a wall with a closed oak door between a copper chest holding 20 cobblestone and a chest, the golem on either side. At tick 700, the destination chest: - **before this change:** the golem never got through; the destination chest is empty (`7,-60,0 - 0`); - **with this change, and in vanilla:** all 20 cobblestone are in the destination chest, and the door's open sound is played at the same tick with the same pitch (`3f696536`). The whole harness still matches: 209/209 scenarios, 61114/61114 mob-ticks (a copper golem's brain changed). ## Not tick for tick yet The two door scenarios diverge by one step at tick 115 to 119, so they are not added to the harness (they would fail CI). In vanilla the door opening calls `ServerLevel.sendBlockUpdated`, which makes every mob whose path is near recompute it at once (`PathNavigation.shouldRecomputePath`, the row of that name), before the same tick's movement; Horizon does not recompute on a block change, so the golem keeps its 9 node path one tick longer than vanilla's new 6 node one. That belongs to the `shouldRecomputePath` row, which is next. Also left out: a golem does not look for another golem coming through the door (`areOtherMobsComingThroughDoor`), and piglins (the probe has no piglin brain). `pr_ready --quick`: fmt, clippy, 1064 tests and 481 python tests pass. 🤖 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-03 05:14:13 +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#5671
No description provided.