[PR #7321] [MERGED] port map: rest-002's type_specific predicates are read on the loot side #7491

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

📋 Pull Request Information

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

Base: main ← Head: chore/vol-c-rest-002


📝 Commits (2)

  • 8bebe92 port_map: the three type_specific entity predicates the loot side reads
  • 97fe3e6 port_map: rest-002's tag, component and lightning notes cite the code

📊 Changes

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

View changed files

📝 tools/port_map/rest-002.tsv (+6 -6)

📄 Description

Rows of tools/port_map/rest-002.tsv (149 rows, map-check clean against 26.3): the advancement predicates — CubeMobPredicate, SheepPredicate, RaiderPredicate, TagPredicate, SingleComponentItemPredicate, LightningBoltPredicate — and the trigger rows below them.

Verdicts

row was now where
CubeMobPredicate.matches missing inline crates/horizon-world/src/loot.rs::Context::entity_matches
RaiderPredicate.matches missing inline crates/horizon-world/src/loot.rs::Context::entity_matches
SheepPredicate.matches missing inline crates/horizon-world/src/loot.rs::Context::entity_matches

The three were filed as missing, "type_specific/… is not read". One of the two readers does read them: loot::Context::entity_matches carries

  • minecraft:type_specific/cube_mob — int_bounds(&v["size"], size) against the mob's own cube_size;
  • minecraft:type_specific/raider — is_captain against the mob's captain flag, has_raid against "no raid is running here";
  • minecraft:type_specific/sheep — the sheared flag.

The other reader, advancements.rs::entity, keeps the gap the rows were pointing at: an unknown key falls to _ => false, so an advancement predicate asking for one of these never matches, while the loot table's copy of the same vanilla class does. The notes say both halves now.

Notes repaired

  • TagPredicate.matches pointed at advancements.rs::id_matches, which matches an id or a tag for items and entities and has no expected flag at all. The method's only caller is DamageSourcePredicate.matches, whose port advancements.rs::damage_source compares the damage type's tag membership against the predicate's expected — so the row cites damage_source now, and the "negated expected=false form is not kept" gap is gone.
  • SingleComponentItemPredicate.matches said other components are ignored; it now names one the shipped data asks for. adventure/play_jukebox_in_meadows tests the tool with predicates: {"minecraft:jukebox_playable": {}} and nothing else, so with that component ignored the match_tool test in advancements.rs::item passes for any item.
  • LightningBoltPredicate.matches claimed blocks_set_on_fire was checked against 0 and that the lightning trigger never fires. Neither holds: the arm compares range_i(&p["blocks_set_on_fire"], e.blocks_set_on_fire), game/lightning.rs fills that count from the fires the bolt set, and game/advancements.rs::trigger_lightning_strike fires the trigger.

Checked against the 26.3 data and left as they were, so the next reader does not redo them: every other "no vanilla advancement uses it" note in the file — entity_tags, movement, movement_affected_by, targeted_entity, team, custom_data, advancements (player predicate), slots (item predicate) — has no key in any of the 1866 advancement files; minecraft:flags is used 5 times and only ever as is_baby, as its row says; and the predicates key the rows call ignored is the item-side one in the jukebox advancement, not an entity predicate's.

Map-check:

PORT_LEDGER_OUT=... python3 tools/port_ledger.py map-check tools/port_map/rest-002.tsv
149 rows, no problems.

Proven: the three arms read at entity_matches (the cube_mob, raider and sheep keys, and _ => false on the advancement side); the tag comparison at damage_source, including its expected default of true; item's predicates handling and id_matches' null-means-any; the bolt's count at game/lightning.rs and the trigger at game/advancements.rs; and the absence claims from a scan of every advancement file's keys in the client jar.

Not proven: that the advancement reader should grow the three arms — no shipped advancement uses them, so I left that as a note rather than a verdict; and I did not run a predicate through a live advancement to see the _ => false deny.


🔄 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/7321 **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/vol-c-rest-002` --- ### 📝 Commits (2) - [`8bebe92`](https://github.com/horizon-rust/horizon/commit/8bebe92031cec64abfeab1a02600609a953cf952) port_map: the three type_specific entity predicates the loot side reads - [`97fe3e6`](https://github.com/horizon-rust/horizon/commit/97fe3e6ec90def7fdf836ebf03bfe9920392cd2f) port_map: rest-002's tag, component and lightning notes cite the code ### 📊 Changes **1 file changed** (+6 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `tools/port_map/rest-002.tsv` (+6 -6) </details> ### 📄 Description Rows of `tools/port_map/rest-002.tsv` (149 rows, map-check clean against 26.3): the advancement predicates — `CubeMobPredicate`, `SheepPredicate`, `RaiderPredicate`, `TagPredicate`, `SingleComponentItemPredicate`, `LightningBoltPredicate` — and the trigger rows below them. **Verdicts** | row | was | now | where | | --- | --- | --- | --- | | `CubeMobPredicate.matches` | missing | inline | `crates/horizon-world/src/loot.rs::Context::entity_matches` | | `RaiderPredicate.matches` | missing | inline | `crates/horizon-world/src/loot.rs::Context::entity_matches` | | `SheepPredicate.matches` | missing | inline | `crates/horizon-world/src/loot.rs::Context::entity_matches` | The three were filed as missing, "`type_specific/…` is not read". One of the two readers does read them: `loot::Context::entity_matches` carries - `minecraft:type_specific/cube_mob` — `int_bounds(&v["size"], size)` against the mob's own `cube_size`; - `minecraft:type_specific/raider` — `is_captain` against the mob's captain flag, `has_raid` against "no raid is running here"; - `minecraft:type_specific/sheep` — the `sheared` flag. The other reader, `advancements.rs::entity`, keeps the gap the rows were pointing at: an unknown key falls to `_ => false`, so an *advancement* predicate asking for one of these never matches, while the loot table's copy of the same vanilla class does. The notes say both halves now. **Notes repaired** - `TagPredicate.matches` pointed at `advancements.rs::id_matches`, which matches an id or a tag for items and entities and has no `expected` flag at all. The method's only caller is `DamageSourcePredicate.matches`, whose port `advancements.rs::damage_source` compares the damage type's tag membership against the predicate's `expected` — so the row cites `damage_source` now, and the "negated `expected=false` form is not kept" gap is gone. - `SingleComponentItemPredicate.matches` said other components are ignored; it now names one the shipped data asks for. `adventure/play_jukebox_in_meadows` tests the tool with `predicates: {"minecraft:jukebox_playable": {}}` and nothing else, so with that component ignored the `match_tool` test in `advancements.rs::item` passes for any item. - `LightningBoltPredicate.matches` claimed `blocks_set_on_fire` was checked against 0 and that the lightning trigger never fires. Neither holds: the arm compares `range_i(&p["blocks_set_on_fire"], e.blocks_set_on_fire)`, `game/lightning.rs` fills that count from the fires the bolt set, and `game/advancements.rs::trigger_lightning_strike` fires the trigger. Checked against the 26.3 data and left as they were, so the next reader does not redo them: every other "no vanilla advancement uses it" note in the file — `entity_tags`, `movement`, `movement_affected_by`, `targeted_entity`, `team`, `custom_data`, `advancements` (player predicate), `slots` (item predicate) — has no key in any of the 1866 advancement files; `minecraft:flags` is used 5 times and only ever as `is_baby`, as its row says; and the `predicates` key the rows call ignored is the item-side one in the jukebox advancement, not an entity predicate's. Map-check: ``` PORT_LEDGER_OUT=... python3 tools/port_ledger.py map-check tools/port_map/rest-002.tsv 149 rows, no problems. ``` **Proven:** the three arms read at `entity_matches` (the `cube_mob`, `raider` and `sheep` keys, and `_ => false` on the advancement side); the tag comparison at `damage_source`, including its `expected` default of true; `item`'s `predicates` handling and `id_matches`' null-means-any; the bolt's count at `game/lightning.rs` and the trigger at `game/advancements.rs`; and the absence claims from a scan of every advancement file's keys in the client jar. **Not proven:** that the advancement reader *should* grow the three arms — no shipped advancement uses them, so I left that as a note rather than a verdict; and I did not run a predicate through a live advancement to see the `_ => false` deny. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:40:06 +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#7491
No description provided.