[PR #7619] A path node on a cauldron moves onto its rim #7720

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

📋 Pull Request Information

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

Base: main ← Head: fix/path-cauldron-nodes


📝 Commits (3)

  • 5dbd0e8 fix: a path node on a cauldron moves onto its rim
  • 46faadb test: the cauldron raise of a path
  • 8871870 port_map: PathNavigation.trimPath and Node.cloneAndMove are ported

📊 Changes

4 files changed (+102 additions, -4 deletions)

View changed files

📝 crates/horizon-client/src/mobs/nav.rs (+8 -2)
📝 crates/horizon-client/src/mobs/path.rs (+92 -0)
📝 tools/port_map/game-010.tsv (+1 -1)
📝 tools/port_map/game2-023.tsv (+1 -1)

📄 Description

Vanilla

PathNavigation.trimPath() (javap -p -c -constants -cp ... net.minecraft.world.entity.ai.navigation.PathNavigation) walks every node of the path and, when the block under it is in BlockTags.CAULDRONS, moves that node one block up and the node after it with it:

 88: getstatic     #486  // Field net/minecraft/tags/BlockTags.CAULDRONS
 91: invokevirtual #492  // BlockState.is:(Lnet/minecraft/tags/TagKey;)Z
101..120: path.replaceNode(i, node.cloneAndMove(x, y + 1, z))
127: aload_2              // the node, before it moved
128: getfield      #479  // Field Node.y:I
131: aload_3
132: getfield      #479  // Field Node.y:I   (the next node)
135: if_icmplt     166    // skip when node.y < next.y
138..163: path.replaceNode(i + 1, node.cloneAndMove(next.x, node.y + 1, next.z))

GroundPathNavigation.trimPath() calls it first (0: invokespecial PathNavigation.trimPath) and only then applies avoidSun, and PathNavigation.moveTo(Path, double) runs trimPath before it checks path.getNodeCount() <= 0.

So a route whose nodes stand on a cauldron ends one block higher - on the rim - instead of inside the block.

Horizon

Mob::trim_path (called from nav_move_to_path, the moveTo(Path, speed) port) only had the avoid_sun half. A path that ended on a cauldron - a leatherworker's job site, a cauldron beside a farm - kept its nodes in the block, so the mob walked into the cauldron's side and stopped there instead of standing on it.

The raise is now Path::raise_cauldron_nodes, run for every navigation kind before the sun trim, mirroring vanilla's base-class trimPath plus ground override.

Proven:

  • cargo test -p horizon-client-lib --lib mobs::path: 3 passed; 0 failed.
  • With raise_cauldron_nodes stubbed out, the same tests fail with the values the fix supplies:
    • a_node_on_a_cauldron_is_raised_onto_its_rim: left: PathNode { x: 2, y: 63, z: 0, kind: Open }, right: PathNode { x: 2, y: 64, z: 0, kind: Open }.
    • the_node_after_a_cauldron_follows_it_up: left: [ (0, 63, 0), (1, 63, 0) ], right: [ (0, 64, 0), (1, 64, 0) ].
  • cargo clippy -q -p horizon-client-lib --lib is silent; rustfmt --edition 2024 --check on both files is clean.

Not proven:

  • No live-world check that a villager now stands on a cauldron rim; that needs a village with a leatherworker job site and the extracted data, which the unit tests do not use.
  • The corridors the raise opens (a path node raised next to a wall) are not exercised beyond the node arithmetic.

🔄 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/7619 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/path-cauldron-nodes` --- ### 📝 Commits (3) - [`5dbd0e8`](https://github.com/horizon-rust/horizon/commit/5dbd0e80885ed1649340073680197c2691036ec1) fix: a path node on a cauldron moves onto its rim - [`46faadb`](https://github.com/horizon-rust/horizon/commit/46faadbaec2173fe83b2ab9a542704332e9586a8) test: the cauldron raise of a path - [`8871870`](https://github.com/horizon-rust/horizon/commit/8871870a613535969d312c56c4ed7be810615a7b) port_map: PathNavigation.trimPath and Node.cloneAndMove are ported ### 📊 Changes **4 files changed** (+102 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/nav.rs` (+8 -2) 📝 `crates/horizon-client/src/mobs/path.rs` (+92 -0) 📝 `tools/port_map/game-010.tsv` (+1 -1) 📝 `tools/port_map/game2-023.tsv` (+1 -1) </details> ### 📄 Description ### Vanilla `PathNavigation.trimPath()` (`javap -p -c -constants -cp ... net.minecraft.world.entity.ai.navigation.PathNavigation`) walks every node of the path and, when the block under it is in `BlockTags.CAULDRONS`, moves that node one block up and the node after it with it: ``` 88: getstatic #486 // Field net/minecraft/tags/BlockTags.CAULDRONS 91: invokevirtual #492 // BlockState.is:(Lnet/minecraft/tags/TagKey;)Z 101..120: path.replaceNode(i, node.cloneAndMove(x, y + 1, z)) 127: aload_2 // the node, before it moved 128: getfield #479 // Field Node.y:I 131: aload_3 132: getfield #479 // Field Node.y:I (the next node) 135: if_icmplt 166 // skip when node.y < next.y 138..163: path.replaceNode(i + 1, node.cloneAndMove(next.x, node.y + 1, next.z)) ``` `GroundPathNavigation.trimPath()` calls it first (`0: invokespecial PathNavigation.trimPath`) and only then applies `avoidSun`, and `PathNavigation.moveTo(Path, double)` runs `trimPath` before it checks `path.getNodeCount() <= 0`. So a route whose nodes stand on a cauldron ends one block higher - on the rim - instead of inside the block. ### Horizon `Mob::trim_path` (called from `nav_move_to_path`, the `moveTo(Path, speed)` port) only had the `avoid_sun` half. A path that ended on a cauldron - a leatherworker's job site, a cauldron beside a farm - kept its nodes in the block, so the mob walked into the cauldron's side and stopped there instead of standing on it. The raise is now `Path::raise_cauldron_nodes`, run for every navigation kind before the sun trim, mirroring vanilla's base-class `trimPath` plus ground override. **Proven:** - `cargo test -p horizon-client-lib --lib mobs::path`: `3 passed; 0 failed`. - With `raise_cauldron_nodes` stubbed out, the same tests fail with the values the fix supplies: - `a_node_on_a_cauldron_is_raised_onto_its_rim`: `left: PathNode { x: 2, y: 63, z: 0, kind: Open }, right: PathNode { x: 2, y: 64, z: 0, kind: Open }`. - `the_node_after_a_cauldron_follows_it_up`: `left: [ (0, 63, 0), (1, 63, 0) ], right: [ (0, 64, 0), (1, 64, 0) ]`. - `cargo clippy -q -p horizon-client-lib --lib` is silent; `rustfmt --edition 2024 --check` on both files is clean. **Not proven:** - No live-world check that a villager now stands on a cauldron rim; that needs a village with a leatherworker job site and the extracted data, which the unit tests do not use. - The corridors the raise opens (a path node raised next to a wall) are not exercised beyond the node arithmetic. --- <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#7720
No description provided.