[PR #4869] [MERGED] Native mods: read block and item tags #5901

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4869
Author: @arismoko
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @levzzz5154

Base: main ← Head: native-tag-checks


📝 Commits (2)

  • 142424b Native mods: read block and item tags
  • 1ba0509 Merge hr/main; take native hooks API 28

📊 Changes

5 files changed (+65 additions, -5 deletions)

View changed files

📝 crates/horizon-client/src/game/advancements.rs (+2 -2)
📝 crates/horizon-client/src/game/native_hooks.rs (+4 -1)
📝 crates/horizon-client/src/game/native_world_read.rs (+34 -1)
📝 crates/horizon-items/src/items.rs (+23 -1)
📝 docs/native-mods.md (+2 -0)

📄 Description

🤖 Opened by Aria's agent swarm, Dyna, not by Aria.

Closes #4807.

Add server-tick helpers native_block_in_tag and native_item_in_tag. Both require the same active context as native_server_block. They query the world's existing merged tags, including data packs and content mods. Unknown tags return false. Empty item stacks query minecraft:air, matching vanilla's ItemStack.typeHolder.

Vanilla counterparts: BlockState.is(TagKey<Block>) and ItemStack.is(TagKey<Item>). These are lookup helpers, not new NeoForge event hooks.

Real game, exact head 7ea770ed1aa98836716eb7dc39a701c4e05f3614: a throwaway native server-tick mod ran on the integrated server thread and a dedicated server. In each, block minecraft:oak_log in block tag minecraft:logs returned true; minecraft:stone returned false. Item minecraft:oak_log in item tag minecraft:logs returned true; minecraft:stone returned false.

On arch with Xvfb, remote_fireball, remote_fireworks, return_to_sender and server_player_sculk passed on this head. friends_integration timed out waiting for the host world with zero chunks. mob_ai missed the player hurt sound in bee_sting at tick 67. Both failures reproduced on unchanged upstream base 2789409634 under the same conditions. The readiness block below records the original desktop run without a display.

Head 142424b58 is 7ea770ed1 rebased onto main after #4746, #4817, #4574 and #4700 merged; only the surrounding docs lines changed (git range-diff shows the same patch, and cargo check -p horizon-client passes on it), so the checks above, run on 7ea770ed1, still apply.

pr_ready (tools/pr_ready.py --base upstream/main on desktop, against upstream/main at 278940963, 25 min 19 s)

Check Result
Scope ✅ 4 files, +61 −4
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 481 passed (18 s)
rustfmt ✅ (6 s)
clippy ✅ (30 s)
tests: horizon-client, horizon-items ✅ 1268 passed (2 min 56 s)
doc tests ✅ 0 passed (1 s)
content root tests ✅ 6 passed (36 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ❌ 64 affected, 57 passed, failed: friends_integration, mob_ai, remote_fireball, remote_fireworks, return_to_sender, server_player_sculk (20 min 47 s)
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🔄 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/4869 **Author:** [@arismoko](https://github.com/arismoko) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `native-tag-checks` --- ### 📝 Commits (2) - [`142424b`](https://github.com/horizon-rust/horizon/commit/142424b58fd51f6085084f8284499a8715d6fc1e) Native mods: read block and item tags - [`1ba0509`](https://github.com/horizon-rust/horizon/commit/1ba05096b8aa114c459989c4c11847e7170eecda) Merge hr/main; take native hooks API 28 ### 📊 Changes **5 files changed** (+65 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/advancements.rs` (+2 -2) 📝 `crates/horizon-client/src/game/native_hooks.rs` (+4 -1) 📝 `crates/horizon-client/src/game/native_world_read.rs` (+34 -1) 📝 `crates/horizon-items/src/items.rs` (+23 -1) 📝 `docs/native-mods.md` (+2 -0) </details> ### 📄 Description > 🤖 Opened by Aria's agent swarm, Dyna, not by Aria. Closes #4807. Add server-tick helpers `native_block_in_tag` and `native_item_in_tag`. Both require the same active context as `native_server_block`. They query the world's existing merged tags, including data packs and content mods. Unknown tags return false. Empty item stacks query `minecraft:air`, matching vanilla's `ItemStack.typeHolder`. Vanilla counterparts: `BlockState.is(TagKey<Block>)` and `ItemStack.is(TagKey<Item>)`. These are lookup helpers, not new NeoForge event hooks. Real game, exact head 7ea770ed1aa98836716eb7dc39a701c4e05f3614: a throwaway native server-tick mod ran on the integrated server thread and a dedicated server. In each, block `minecraft:oak_log` in block tag `minecraft:logs` returned true; `minecraft:stone` returned false. Item `minecraft:oak_log` in item tag `minecraft:logs` returned true; `minecraft:stone` returned false. On arch with Xvfb, remote_fireball, remote_fireworks, return_to_sender and server_player_sculk passed on this head. friends_integration timed out waiting for the host world with zero chunks. mob_ai missed the player hurt sound in bee_sting at tick 67. Both failures reproduced on unchanged upstream base 27894096345a84370b061d72f370bb9a2e6a23c0 under the same conditions. The readiness block below records the original desktop run without a display. Head `142424b58` is `7ea770ed1` rebased onto main after #4746, #4817, #4574 and #4700 merged; only the surrounding docs lines changed (`git range-diff` shows the same patch, and `cargo check -p horizon-client` passes on it), so the checks above, run on `7ea770ed1`, still apply. **pr_ready** (`tools/pr_ready.py --base upstream/main` on desktop, against upstream/main at 278940963, 25 min 19 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +61 −4 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 481 passed (18 s) | | rustfmt | ✅ (6 s) | | clippy | ✅ (30 s) | | tests: horizon-client, horizon-items | ✅ 1268 passed (2 min 56 s) | | doc tests | ✅ 0 passed (1 s) | | content root tests | ✅ 6 passed (36 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ❌ 64 affected, 57 passed, failed: friends_integration, mob_ai, remote_fireball, remote_fireworks, return_to_sender, server_player_sculk (20 min 47 s) | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:15:48 +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#5901
No description provided.