[PR #6909] [MERGED] feat(mods): let a mod's blocks be signs, by their template #7183

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

📋 Pull Request Information

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

Base: main ← Head: feat/mod-signs


📝 Commits (2)

📊 Changes

18 files changed (+880 additions, -74 deletions)

View changed files

📝 crates/horizon-client-render/src/block_entity_render.rs (+28 -14)
📝 crates/horizon-client-render/src/minimap.rs (+2 -0)
📝 crates/horizon-client-render/src/signs.rs (+29 -10)
📝 crates/horizon-client/src/game.rs (+16 -14)
📝 crates/horizon-client/src/game/lan.rs (+8 -6)
📝 crates/horizon-client/src/game/native_hooks.rs (+113 -0)
📝 crates/horizon-client/src/game/render_control.rs (+2 -1)
📝 crates/horizon-client/src/game/respawn_anchor.rs (+1 -1)
📝 crates/horizon-client/src/game/sign_edit.rs (+12 -15)
📝 crates/horizon-client/src/game/world_loading.rs (+8 -3)
📝 crates/horizon-client/src/lan/chunks.rs (+115 -4)
📝 crates/horizon-client/src/mod_content.rs (+37 -5)
📝 crates/horizon-client/src/mod_content_tests.rs (+182 -0)
📝 crates/horizon-client/src/structure_blocks.rs (+39 -1)
📝 crates/horizon-client/src/vanillagen.rs (+10 -0)
📝 crates/horizon-items/src/blocks.rs (+50 -0)
📝 crates/horizon-mods/src/content.rs (+202 -0)
📝 docs/mods.md (+26 -0)

📄 Description

🤖 Opened by navinor's AI agent (OpenCode, Claude Opus 5.5 and GPT-6.1 Sol), not by navinor personally.

What and why

Fixes #5532. A mod block became a sign only when its name ended in _sign, and even then its text never reached a client: the chunk encoder gave every mod block its own block entity type and dropped any entity that wasn't the mod's. Its item placed vanilla's wall sign, and its editor looked for a texture named after the block.

Vanilla decides by class (SignBlock.newBlockEntity, instanceof SignBlock). A content block takes its template's class chain, so Horizon now goes by StateFacts::sign_form (the SignBlock subclass) wherever it asked for a sign by name:

  • the gameplay block entity constructor (checked before the name-based BlockEntity::for_block, so ruby:notice_banner with a sign template is a sign), the renderer, the editor, hanging-sign chaining (CeilingHangingSignBlock.useItemOn), respawning (isPossibleToRespawnInThis), render signedit;
  • the chunk encoder (ChunkEncoder::with_signs) and structure templates send and save mod signs with vanilla's minecraft:sign and minecraft:hanging_sign block entity types, so text, glow ink, dye, wax and saving take vanilla's paths;
  • world generation gives a sign that a feature places its block entity (WorldGenRegion.setBlock), through VanillaTerrain::add_mod_signs.

A content block declares wood_type (its WoodType: the editor's background, a mod texture or a vanilla name) and wall_block (StandingAndWallBlockItem.wallBlock: the wall form its item places). The wall form is one of the same mod's blocks, with the matching wall template and "item": false; a pair that doesn't fit refuses that mod alone when it is read or declared. sign_kind still recognises vanilla's own blocks by name, and a stone block named road_sign is no longer a sign. docs/mods.md documents the declaration, the models and the tags.

Known limits, in the docs: a wall form whose name isn't <x>_wall_sign needs its own loot table (vanilla's wallVariant takes the standing table); a file sign's wall form must be declared in files too.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

SignBlock.newBlockEntity and getWoodType, WallSignBlock, CeilingHangingSignBlock.useItemOn (shouldTryToChainAnotherHangingSign), WallHangingSignBlock, HangingSignBlockEntity, SignBlockEntity, StandingAndWallBlockItem, HangingSignItem, AbstractSignEditScreen / SignEditScreen, Block.isPossibleToRespawnInThis, WorldGenRegion.setBlock.

Tests:

  • horizon-mods: signs_name_their_wood_and_wall_form, a_signs_wall_block_is_its_own_mods_wall_form (runs in CI).
  • lan::chunks::tests::a_mods_sign_goes_out_with_vanillas_type_and_its_text, structure_blocks::tests::a_saved_mod_sign_uses_its_vanilla_entity_type, signs::tests::a_mods_sign_like_name_does_not_make_it_a_sign, renderer and minimap tests.
  • Content-root tests (--ignored, run by CI and pr_ready): signs_take_their_form_wood_and_wall_block_from_their_declaration; a_feature_gives_a_mods_sign_its_block_entity asserts a feature-placed mod sign has no block entity without add_mod_signs and one per block with it.
  • game::native_hooks::tests::mod_sign_constructor_prioritizes_templates_over_suffixes is #[ignore] and needs HORIZON_TEST_RESOURCES, so CI doesn't run it. Locally it failed with ruby:notice_banner: expected a sign, got Some(Banner(...)) when the name check was moved back ahead of the class check, and passes as committed.

Harness: none covers mod signs; CI's parity job picks the affected ones.

Other projects' code

None.

Self-check

pr_ready (tools/pr_ready.py --quick --base 6eea3303f on Aaron, against 6eea3303f at 6eea3303f, 19 min 50 s)

Check Result
Scope ⚠️ 18 files, +883 −76; 933 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 609 passed (2 min 15 s)
rustfmt ✅ (12 s)
clippy ✅ (2 min 7 s)
tests: horizon-client, horizon-client-lib, horizon-client-render, horizon-items, horizon-mods ❌ 3066 passed, 1 failed (8 min 45 s)
doc tests ✅ 0 passed (17 s)
content root tests ✅ 23 passed (2 min 40 s)
mod API up to date ❌ failed (20 s)
tokens.css up to date Γ₧û theme untouched
launcher rustfmt ✅ (1 s)
launcher clippy ✅ (1 min 15 s)
launcher tests ✅ 413 passed (1 min 52 s)
Parity Γ₧û not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Two rows fail on this Windows checkout, in tests this commit doesn't touch; CI runs both on Linux:

  • gfx::entity_skin::tests::the_shader_writes_what_the_cpu_reference_computes differs by one float ULP between this GPU and the CPU reference (1.2150468 vs 1.2150469). entity_skin.rs isn't in this diff.
  • mod_api::tests::new_hook_placeholder_is_reported_then_filled (the mod API up to date row) reads source with CRLF line endings on this checkout. xtask/ isn't in this diff.

The scope row is over the ~500-line guideline. mod_content_tests.rs and docs/mods.md alone are 208 of the added lines, other tests sit inline in the changed files, and the sign forms only work together, so this stays one change. game::native_hooks::tests::mod_sign_constructor_prioritizes_templates_over_suffixes is #[ignore]d, so neither this block nor CI runs it. Clippy and the content root tests above cover the rebased commit; the in-game runs below used binaries from just before the rebase onto 6eea3303f, whose one conflict was two added methods side by side in block_entity_render.rs.

Screenshots

A content mod (made only for this check, not committed) declares four elm signs named without _sign: notice (oak sign template, wall_block board), board, placard (spruce hanging sign, wall_block bracket) and bracket, plus a stone road_sign. A scripted run places each form with its item, writes text in the editor, applies glow ink, cyan dye and honeycomb, chains a hanging sign under the ceiling one, checks every block and its NBT with /execute if block and /data get block, compares what the client holds, then restarts and checks again. The same script runs on the default integrated server thread and on --dedicated --nogui with a client joined over TCP. Results, on binaries built just before the final rebase (after them only a doc comment and a docs line changed in this commit):

Run Assertions Failed
Server thread: place, edit, glow, dye, wax, chain, restart 149 0
Server thread: rejoin, edit again, second restart 100 0
Server thread: wall sign front and back 17 0
Dedicated: place, edit, glow, dye, wax, chain, restart 149 0
Dedicated: wall sign front and back 17 0

The stone road_sign opened no editor and had no block entity on the server or the client. Wax stopped the editor from opening.

Server thread, the four forms after a restart:

Server thread: four mod signs after restart

The editors use the mod's wood (wood_type):

Mod sign editor with the mod wood

Mod hanging sign editor

The wall hanging sign's back text after the restart:

Wall hanging sign back text after restart

Dedicated server, the four forms after its restart, and a wall sign's back text read from behind:

Dedicated server: four mod signs after restart

Dedicated server: wall sign back text

Before this change, a block like these with a non-_sign name had no sign block entity at all, so there is no comparable before picture.

Reviewed with sol-loop: 3 rounds with GPT-6.1 Sol on xhigh, the last on this exact commit, plus 2 rounds with Claude Opus 5.5 (high) while Sol was unavailable. Opus's findings (feature-placed signs, a cross-mod wall_block unloading every content mod, render signedit) were fixed. Sol verdict: approved.

🤖 Generated with OpenCode, Claude Opus 5.5 and GPT-6.1 Sol.


🔄 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/6909 **Author:** [@navinor](https://github.com/navinor) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/mod-signs` --- ### 📝 Commits (2) - [`bb6ec90`](https://github.com/horizon-rust/horizon/commit/bb6ec90df7d5980df0e2c5a3d8d074b0056b247c) Let a mod's blocks be signs, by their template - [`642d5e1`](https://github.com/horizon-rust/horizon/commit/642d5e1f419fba7d1a43a5b96ca66c8390facaec) Merge main into #6909 ### 📊 Changes **18 files changed** (+880 additions, -74 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/block_entity_render.rs` (+28 -14) 📝 `crates/horizon-client-render/src/minimap.rs` (+2 -0) 📝 `crates/horizon-client-render/src/signs.rs` (+29 -10) 📝 `crates/horizon-client/src/game.rs` (+16 -14) 📝 `crates/horizon-client/src/game/lan.rs` (+8 -6) 📝 `crates/horizon-client/src/game/native_hooks.rs` (+113 -0) 📝 `crates/horizon-client/src/game/render_control.rs` (+2 -1) 📝 `crates/horizon-client/src/game/respawn_anchor.rs` (+1 -1) 📝 `crates/horizon-client/src/game/sign_edit.rs` (+12 -15) 📝 `crates/horizon-client/src/game/world_loading.rs` (+8 -3) 📝 `crates/horizon-client/src/lan/chunks.rs` (+115 -4) 📝 `crates/horizon-client/src/mod_content.rs` (+37 -5) 📝 `crates/horizon-client/src/mod_content_tests.rs` (+182 -0) 📝 `crates/horizon-client/src/structure_blocks.rs` (+39 -1) 📝 `crates/horizon-client/src/vanillagen.rs` (+10 -0) 📝 `crates/horizon-items/src/blocks.rs` (+50 -0) 📝 `crates/horizon-mods/src/content.rs` (+202 -0) 📝 `docs/mods.md` (+26 -0) </details> ### 📄 Description > 🤖 Opened by navinor's AI agent (OpenCode, Claude Opus 5.5 and GPT-6.1 Sol), not by navinor personally. ## What and why Fixes #5532. A mod block became a sign only when its name ended in `_sign`, and even then its text never reached a client: the chunk encoder gave every mod block its own block entity type and dropped any entity that wasn't the mod's. Its item placed vanilla's wall sign, and its editor looked for a texture named after the block. Vanilla decides by class (`SignBlock.newBlockEntity`, `instanceof SignBlock`). A content block takes its template's class chain, so Horizon now goes by `StateFacts::sign_form` (the `SignBlock` subclass) wherever it asked for a sign by name: - the gameplay block entity constructor (checked before the name-based `BlockEntity::for_block`, so `ruby:notice_banner` with a sign template is a sign), the renderer, the editor, hanging-sign chaining (`CeilingHangingSignBlock.useItemOn`), respawning (`isPossibleToRespawnInThis`), `render signedit`; - the chunk encoder (`ChunkEncoder::with_signs`) and structure templates send and save mod signs with vanilla's `minecraft:sign` and `minecraft:hanging_sign` block entity types, so text, glow ink, dye, wax and saving take vanilla's paths; - world generation gives a sign that a feature places its block entity (`WorldGenRegion.setBlock`), through `VanillaTerrain::add_mod_signs`. A content block declares `wood_type` (its `WoodType`: the editor's background, a mod texture or a vanilla name) and `wall_block` (`StandingAndWallBlockItem.wallBlock`: the wall form its item places). The wall form is one of the same mod's blocks, with the matching wall template and `"item": false`; a pair that doesn't fit refuses that mod alone when it is read or declared. `sign_kind` still recognises vanilla's own blocks by name, and a stone block named `road_sign` is no longer a sign. `docs/mods.md` documents the declaration, the models and the tags. Known limits, in the docs: a wall form whose name isn't `<x>_wall_sign` needs its own loot table (vanilla's `wallVariant` takes the standing table); a file sign's wall form must be declared in files too. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [x] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference `SignBlock.newBlockEntity` and `getWoodType`, `WallSignBlock`, `CeilingHangingSignBlock.useItemOn` (`shouldTryToChainAnotherHangingSign`), `WallHangingSignBlock`, `HangingSignBlockEntity`, `SignBlockEntity`, `StandingAndWallBlockItem`, `HangingSignItem`, `AbstractSignEditScreen` / `SignEditScreen`, `Block.isPossibleToRespawnInThis`, `WorldGenRegion.setBlock`. Tests: - `horizon-mods`: `signs_name_their_wood_and_wall_form`, `a_signs_wall_block_is_its_own_mods_wall_form` (runs in CI). - `lan::chunks::tests::a_mods_sign_goes_out_with_vanillas_type_and_its_text`, `structure_blocks::tests::a_saved_mod_sign_uses_its_vanilla_entity_type`, `signs::tests::a_mods_sign_like_name_does_not_make_it_a_sign`, renderer and minimap tests. - Content-root tests (`--ignored`, run by CI and pr_ready): `signs_take_their_form_wood_and_wall_block_from_their_declaration`; `a_feature_gives_a_mods_sign_its_block_entity` asserts a feature-placed mod sign has no block entity without `add_mod_signs` and one per block with it. - `game::native_hooks::tests::mod_sign_constructor_prioritizes_templates_over_suffixes` is `#[ignore]` and needs `HORIZON_TEST_RESOURCES`, so CI doesn't run it. Locally it failed with `ruby:notice_banner: expected a sign, got Some(Banner(...))` when the name check was moved back ahead of the class check, and passes as committed. Harness: none covers mod signs; CI's parity job picks the affected ones. ## Other projects' code None. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base 6eea3303f` on Aaron, against 6eea3303f at 6eea3303f, 19 min 50 s) | Check | Result | | --- | --- | | Scope | ΓÜá∩╕Å 18 files, +883 ΓêÆ76; 933 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | Γ£à unchanged | | Public tree | Γ£à | | Python tests | Γ£à 609 passed (2 min 15 s) | | rustfmt | Γ£à (12 s) | | clippy | Γ£à (2 min 7 s) | | tests: horizon-client, horizon-client-lib, horizon-client-render, horizon-items, horizon-mods | Γ¥î 3066 passed, 1 failed (8 min 45 s) | | doc tests | Γ£à 0 passed (17 s) | | content root tests | Γ£à 23 passed (2 min 40 s) | | mod API up to date | Γ¥î failed (20 s) | | tokens.css up to date | Γ₧û theme untouched | | launcher rustfmt | Γ£à (1 s) | | launcher clippy | Γ£à (1 min 15 s) | | launcher tests | Γ£à 413 passed (1 min 52 s) | | Parity | Γ₧û not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Two rows fail on this Windows checkout, in tests this commit doesn't touch; CI runs both on Linux: - `gfx::entity_skin::tests::the_shader_writes_what_the_cpu_reference_computes` differs by one float ULP between this GPU and the CPU reference (`1.2150468` vs `1.2150469`). `entity_skin.rs` isn't in this diff. - `mod_api::tests::new_hook_placeholder_is_reported_then_filled` (the `mod API up to date` row) reads source with CRLF line endings on this checkout. `xtask/` isn't in this diff. The scope row is over the ~500-line guideline. `mod_content_tests.rs` and `docs/mods.md` alone are 208 of the added lines, other tests sit inline in the changed files, and the sign forms only work together, so this stays one change. `game::native_hooks::tests::mod_sign_constructor_prioritizes_templates_over_suffixes` is `#[ignore]`d, so neither this block nor CI runs it. Clippy and the content root tests above cover the rebased commit; the in-game runs below used binaries from just before the rebase onto `6eea3303f`, whose one conflict was two added methods side by side in `block_entity_render.rs`. ## Screenshots A content mod (made only for this check, not committed) declares four elm signs named without `_sign`: `notice` (oak sign template, `wall_block` `board`), `board`, `placard` (spruce hanging sign, `wall_block` `bracket`) and `bracket`, plus a stone `road_sign`. A scripted run places each form with its item, writes text in the editor, applies glow ink, cyan dye and honeycomb, chains a hanging sign under the ceiling one, checks every block and its NBT with `/execute if block` and `/data get block`, compares what the client holds, then restarts and checks again. The same script runs on the default integrated server thread and on `--dedicated --nogui` with a client joined over TCP. Results, on binaries built just before the final rebase (after them only a doc comment and a docs line changed in this commit): | Run | Assertions | Failed | | --- | --- | --- | | Server thread: place, edit, glow, dye, wax, chain, restart | 149 | 0 | | Server thread: rejoin, edit again, second restart | 100 | 0 | | Server thread: wall sign front and back | 17 | 0 | | Dedicated: place, edit, glow, dye, wax, chain, restart | 149 | 0 | | Dedicated: wall sign front and back | 17 | 0 | The stone `road_sign` opened no editor and had no block entity on the server or the client. Wax stopped the editor from opening. Server thread, the four forms after a restart: ![Server thread: four mod signs after restart](https://github.com/user-attachments/assets/d47ad826-4c7d-4a00-9902-2db27a29b80f) The editors use the mod's wood (`wood_type`): ![Mod sign editor with the mod wood](https://github.com/user-attachments/assets/4d87a269-0b6b-40cd-8d29-54b0ae5118ec) ![Mod hanging sign editor](https://github.com/user-attachments/assets/954e53d6-a959-4330-a36c-918b76cde935) The wall hanging sign's back text after the restart: ![Wall hanging sign back text after restart](https://github.com/user-attachments/assets/100bfa72-cdd2-4304-b751-2513b4407d4c) Dedicated server, the four forms after its restart, and a wall sign's back text read from behind: ![Dedicated server: four mod signs after restart](https://github.com/user-attachments/assets/164255b5-2157-48a6-9eaa-683ed36f7def) ![Dedicated server: wall sign back text](https://github.com/user-attachments/assets/17372e0e-dc87-425b-9d53-94168196f26d) Before this change, a block like these with a non-`_sign` name had no sign block entity at all, so there is no comparable before picture. Reviewed with sol-loop: 3 rounds with GPT-6.1 Sol on xhigh, the last on this exact commit, plus 2 rounds with Claude Opus 5.5 (high) while Sol was unavailable. Opus's findings (feature-placed signs, a cross-mod `wall_block` unloading every content mod, `render signedit`) were fixed. Sol verdict: approved. 🤖 Generated with [OpenCode](https://opencode.ai), Claude Opus 5.5 and GPT-6.1 Sol. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:35:22 +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#7183
No description provided.