[PR #7079] [MERGED] Port ledger: animal-1 rows the animal code now ports #7318

Closed
opened 2026-11-03 06:37:39 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: chore/ledger-animal-1-x


📝 Commits (1)

  • c59fe92 Port ledger: animal-1 rows the animal code now ports

📊 Changes

1 file changed (+5 additions, -5 deletions)

View changed files

📝 tools/port_map/animal-1.tsv (+5 -5)

📄 Description

Corrects five stale rows in tools/port_map/animal-1.tsv, checked against upstream/main (26.3).

row was now
Allay.hasNonMatchingPotion missing inline crates/horizon-client/src/mobs/allay.rs::considers_item_equal
Axolotl.applyImplicitComponent port to entity_nbt.rs::load_bucket_data (no such fn) port to crates/horizon-client/src/entity_nbt.rs::apply_item_components
Axolotl.loadFromBucketTag port to entity_nbt.rs::load_bucket_data (no such fn) port to crates/horizon-client/src/entity_nbt.rs::apply_item_components
Chicken.applyImplicitComponents missing port crates/horizon-client/src/entity_nbt.rs::apply_item_components
Chicken.applyImplicitComponent missing port crates/horizon-client/src/entity_nbt.rs::apply_item_components

Citations:

  • mobs/allay.rs:73 considers_item_equal is held.item == candidate.item && held.potion() == candidate.potion(), its doc naming AllayAi.allayConsidersItemEqual and !hasNonMatchingPotion; it is the test both pickup paths use (game/allays.rs:66 for a NoAI allay's reach pickup, game/allays.rs:79 for the sensor's 32-block search). That is the potion half the row said was missing.
  • entity_nbt.rs:3694 apply_item_components: its chicken arm (3775-3809) reads minecraft:chicken/variant and minecraft:chicken/sound_variant off the stack and sets the mob's variant and sound variant. Both spawn paths call it once the mob is finalized (game.rs, game/creatures.rs) and so do the bucket paths (game/dispenser.rs). The two Axolotl rows cited load_bucket_data, which is the same fn before the spawn-egg commit renamed it; apply_item_components still reads minecraft:axolotl/variant and the bucket_entity_data age, age lock and hunting cooldown those rows answer for.

map-check (build of upstream/main with the 26.3 client and server jars, 76807 methods):

$ PORT_LEDGER_OUT=/tmp/pledger-a1x python3 tools/port_ledger.py map-check tools/port_map/animal-1.tsv
143 rows, no problems.

Proven: every row above resolves to a fn that exists in this tree, and each one implements the vanilla method it answers: the allay compares the held stack's potion with the candidate's on the pickup path; apply_item_components reads the chicken variant and sound variant components off the spawning or bucketing stack, which is what Chicken.applyImplicitComponents/applyImplicitComponent did; the two Axolotl citations name the fn load_bucket_data became. The other 138 rows in the file were left alone: nothing else in it claimed a gap this tree has since closed.

Not proven: hasNonMatchingPotion compares the whole PotionContents (potion, custom effects, custom colour); StackData keeps only the potion id, so two potions with the same id but different custom effects still count as equal here. The row says so, and the unit tests at mobs/allay.rs:448-471 cover only the id case. Nothing ran beyond map-check: no parity test covers a potion-carrying allay, a spawn egg's chicken variant or a bucketed axolotl's tag.


🔄 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/7079 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `chore/ledger-animal-1-x` --- ### 📝 Commits (1) - [`c59fe92`](https://github.com/horizon-rust/horizon/commit/c59fe9230fe32273b5bc3638a96409bf74544f71) Port ledger: animal-1 rows the animal code now ports ### 📊 Changes **1 file changed** (+5 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `tools/port_map/animal-1.tsv` (+5 -5) </details> ### 📄 Description Corrects five stale rows in `tools/port_map/animal-1.tsv`, checked against `upstream/main` (26.3). | row | was | now | | --- | --- | --- | | `Allay.hasNonMatchingPotion` | `missing` | `inline` `crates/horizon-client/src/mobs/allay.rs::considers_item_equal` | | `Axolotl.applyImplicitComponent` | `port` to `entity_nbt.rs::load_bucket_data` (no such fn) | `port` to `crates/horizon-client/src/entity_nbt.rs::apply_item_components` | | `Axolotl.loadFromBucketTag` | `port` to `entity_nbt.rs::load_bucket_data` (no such fn) | `port` to `crates/horizon-client/src/entity_nbt.rs::apply_item_components` | | `Chicken.applyImplicitComponents` | `missing` | `port` `crates/horizon-client/src/entity_nbt.rs::apply_item_components` | | `Chicken.applyImplicitComponent` | `missing` | `port` `crates/horizon-client/src/entity_nbt.rs::apply_item_components` | Citations: - `mobs/allay.rs:73` `considers_item_equal` is `held.item == candidate.item && held.potion() == candidate.potion()`, its doc naming `AllayAi.allayConsidersItemEqual` and `!hasNonMatchingPotion`; it is the test both pickup paths use (`game/allays.rs:66` for a `NoAI` allay's reach pickup, `game/allays.rs:79` for the sensor's 32-block search). That is the potion half the row said was missing. - `entity_nbt.rs:3694` `apply_item_components`: its chicken arm (3775-3809) reads `minecraft:chicken/variant` and `minecraft:chicken/sound_variant` off the stack and sets the mob's variant and sound variant. Both spawn paths call it once the mob is finalized (`game.rs`, `game/creatures.rs`) and so do the bucket paths (`game/dispenser.rs`). The two `Axolotl` rows cited `load_bucket_data`, which is the same fn before the spawn-egg commit renamed it; `apply_item_components` still reads `minecraft:axolotl/variant` and the `bucket_entity_data` age, age lock and hunting cooldown those rows answer for. map-check (build of `upstream/main` with the 26.3 client and server jars, 76807 methods): ``` $ PORT_LEDGER_OUT=/tmp/pledger-a1x python3 tools/port_ledger.py map-check tools/port_map/animal-1.tsv 143 rows, no problems. ``` **Proven:** every row above resolves to a fn that exists in this tree, and each one implements the vanilla method it answers: the allay compares the held stack's potion with the candidate's on the pickup path; `apply_item_components` reads the chicken variant and sound variant components off the spawning or bucketing stack, which is what `Chicken.applyImplicitComponents`/`applyImplicitComponent` did; the two `Axolotl` citations name the fn `load_bucket_data` became. The other 138 rows in the file were left alone: nothing else in it claimed a gap this tree has since closed. **Not proven:** `hasNonMatchingPotion` compares the whole `PotionContents` (potion, custom effects, custom colour); `StackData` keeps only the potion id, so two potions with the same id but different custom effects still count as equal here. The row says so, and the unit tests at `mobs/allay.rs:448-471` cover only the id case. Nothing ran beyond `map-check`: no parity test covers a potion-carrying allay, a spawn egg's chicken variant or a bucketed axolotl's tag. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:37:39 +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#7318
No description provided.