[PR #7620] [CLOSED] A creaking bound to a heart is refused a portal #7721

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7620
Author: @MSedgeMC
Created: 11/2/2026
Status: ❌ Closed

Base: main ← Head: fix/creaking-refuse-portal


📝 Commits (3)

  • efa1edc fix: refuse a heart-bound creaking the portal
  • 5d4cac1 test: a heart-bound creaking is refused the portal
  • 7a92db8 port_map: Creaking.canUsePortal names can_use_portal

📊 Changes

3 files changed (+40 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game/nether_portal.rs (+3 -1)
📝 crates/horizon-client/src/mobs/creaking.rs (+36 -0)
📝 tools/port_map/game2-003.tsv (+1 -1)

📄 Description

What and why

A creaking bound to a creaking heart could walk into a nether portal and leave the
heart that gives it its protection behind. Vanilla refuses it the portal.

Vanilla reference

Creaking.canUsePortal(boolean) (javap -p -c -cp <26.3 client>):

0: aload_0
1: invokevirtual #368  // Method isHeartBound:()Z
4: ifne          19
7: aload_0
8: iload_1
9: invokespecial #534  // Method Monster.canUsePortal:(Z)Z
12: ifeq         19
15: iconst_1
16: goto         20
19: iconst_0
20: ireturn

isHeartBound() is getHomePos() != null (invokevirtual getHomePos; ifnull 11; iconst_1 ... iconst_0), so a creaking whose home is set is refused before the
parent rule is consulted.

Horizon lacked it: game/nether_portal.rs::mob_can_use_portal tested alive, no
mount, not ridden, the guest-ride rule and the wither, and nothing about the heart,
so a creaking that mobs/creaking.rs::set_transient had bound to a heart
(extra.home) still counted as able to travel.

The change adds mobs/creaking.rs::can_use_portal (the creaking's own
!isHeartBound()) and ANDs it into mob_can_use_portal.

Other projects' code

none

Proven: the ledger was rebuilt with this branch's tree and
python3 tools/port_ledger.py map-check tools/port_map/game2-003.tsv ->
149 rows, no problems. (the row's function exists, the row resolves, and the
map gap it carried is gone). only_a_creaking_bound_to_a_heart_is_refused_the_portal
is the case that fails without the change: a creaking with extra.home set was
allowed the portal before, and can_use_portal — the rule it now asks — did not
exist at all.

Not proven: the crate's tests and clippy were not run: the build VM was
unreachable (instabox host_unavailable) for the whole of this branch's life, so
cargo test -p horizon-client --lib portal_tests, cargo clippy -q -p horizon-client --lib and rustfmt --edition 2024 --check are left to CI. No
in-game walk through a portal with a creaking and its heart either; the other
canUsePortal callers (guest rides, portal cooldowns, canUsePortal(true)) are
unchanged and untested here.


🔄 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/7620 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/creaking-refuse-portal` --- ### 📝 Commits (3) - [`efa1edc`](https://github.com/horizon-rust/horizon/commit/efa1edc7ee33d643a0f54915dc26bc12336c9640) fix: refuse a heart-bound creaking the portal - [`5d4cac1`](https://github.com/horizon-rust/horizon/commit/5d4cac1ae30882bb12e0a5b16bc2f8a478aaf46c) test: a heart-bound creaking is refused the portal - [`7a92db8`](https://github.com/horizon-rust/horizon/commit/7a92db8e78b8298b3d4bc5d0960cc61528f72e78) port_map: Creaking.canUsePortal names can_use_portal ### 📊 Changes **3 files changed** (+40 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/nether_portal.rs` (+3 -1) 📝 `crates/horizon-client/src/mobs/creaking.rs` (+36 -0) 📝 `tools/port_map/game2-003.tsv` (+1 -1) </details> ### 📄 Description ## What and why A creaking bound to a creaking heart could walk into a nether portal and leave the heart that gives it its protection behind. Vanilla refuses it the portal. ## Vanilla reference `Creaking.canUsePortal(boolean)` (`javap -p -c -cp <26.3 client>`): ``` 0: aload_0 1: invokevirtual #368 // Method isHeartBound:()Z 4: ifne 19 7: aload_0 8: iload_1 9: invokespecial #534 // Method Monster.canUsePortal:(Z)Z 12: ifeq 19 15: iconst_1 16: goto 20 19: iconst_0 20: ireturn ``` `isHeartBound()` is `getHomePos() != null` (`invokevirtual getHomePos; ifnull 11; iconst_1 ... iconst_0`), so a creaking whose home is set is refused before the parent rule is consulted. Horizon lacked it: `game/nether_portal.rs::mob_can_use_portal` tested alive, no mount, not ridden, the guest-ride rule and the wither, and nothing about the heart, so a creaking that `mobs/creaking.rs::set_transient` had bound to a heart (`extra.home`) still counted as able to travel. The change adds `mobs/creaking.rs::can_use_portal` (the creaking's own `!isHeartBound()`) and ANDs it into `mob_can_use_portal`. ## Other projects' code none **Proven:** the ledger was rebuilt with this branch's tree and `python3 tools/port_ledger.py map-check tools/port_map/game2-003.tsv` -> `149 rows, no problems.` (the row's function exists, the row resolves, and the `map` gap it carried is gone). `only_a_creaking_bound_to_a_heart_is_refused_the_portal` is the case that fails without the change: a creaking with `extra.home` set was allowed the portal before, and `can_use_portal` — the rule it now asks — did not exist at all. **Not proven:** the crate's tests and clippy were **not** run: the build VM was unreachable (`instabox` `host_unavailable`) for the whole of this branch's life, so `cargo test -p horizon-client --lib portal_tests`, `cargo clippy -q -p horizon-client --lib` and `rustfmt --edition 2024 --check` are left to CI. No in-game walk through a portal with a creaking and its heart either; the other `canUsePortal` callers (guest rides, portal cooldowns, `canUsePortal(true)`) are unchanged and untested here. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 07:22:49 +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#7721
No description provided.