[PR #1928] [MERGED] End city banners keep their template patterns #3871

Closed
opened 2026-11-03 04:12:55 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1928
Author: @levzzz5154
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: fix/end-city-banner-patterns


📝 Commits (2)

  • bb9c474 End city banners keep their template patterns
  • 401ac13 Banners: one loader for saved and generated banners

📊 Changes

2 files changed (+73 additions, -22 deletions)

View changed files

📝 crates/horizon-client/src/save.rs (+12 -11)
📝 crates/horizon-client/src/structure_blocks.rs (+61 -11)

📄 Description

🤖 Opened by levzzz5154's AI agent ([CC], deepseek-v4.1-flash), not by levzzz5154.

What and why

Fixes #1438.

End city banners showed as plain magenta: a structure template saves a banner's layers in its block entity NBT
(patterns), and StructureTemplate.placeInWorld hands that NBT to the level, where
BannerBlockEntity.loadAdditional reads it. Horizon built the client block entity from the block alone
(BlockEntity::for_block), which makes a banner with no layers, so every generated banner came out bare.

structure_blocks::generated_block_entity now loads the banner's NBT the way it already did for spawners, trial
spawners and vaults: banner_from_nbt reads patterns, CustomName and components, exactly the three things
BannerBlockEntity.loadAdditional/saveAdditional carry.

Vanilla reference

  • BannerBlockEntity.loadAdditional → BannerPatternLayers.CODEC on patterns, and CustomName.
  • StructureTemplate.placeInWorld: this.setBlock(..., nbt, ...) for every block that has one.
  • data/minecraft/structure/end_city/tower_top.nbt: eight magenta_wall_banner blocks whose NBT is
    {patterns: [{pattern: "minecraft:triangle_top", color: "black"}, {pattern: "minecraft:triangle_bottom", color: "black"}], id: "minecraft:banner"}.

Test

a_generated_banner_keeps_its_template_patterns: the tower top's two layers reach the block entity with their
patterns and colour, and a banner saved without patterns stays bare.

Scope

One file, +78 −11. cargo test -p horizon-client --lib structure_blocks passes.

🤖 Generated with [CC].

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on cachyos-x8664, against upstream/main at 7fd1f3118, 2 min 20 s)

Check Result
Scope ✅ 1 files, +78 −11
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (4 s)
clippy ❌ failed (8 s)
tests: horizon-client ✅ 1243 passed (2 min 5 s)
doc tests ✅ 0 passed (1 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 269 affected, to run in CI (--quick)
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

clippy fails on crates/horizon-client/src/mobs/axolotl.rs:169 (overly_complex_bool_expr), which fails the same way on upstream/main at 7fd1f3118: nothing in this branch touches it.

🤖 Generated with [CC].


🔄 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/1928 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/end-city-banner-patterns` --- ### 📝 Commits (2) - [`bb9c474`](https://github.com/horizon-rust/horizon/commit/bb9c474c643f45ba551899bfe24ea360daeb2e6e) End city banners keep their template patterns - [`401ac13`](https://github.com/horizon-rust/horizon/commit/401ac1322ffdd9aa72f2fffd927f135176a0ec98) Banners: one loader for saved and generated banners ### 📊 Changes **2 files changed** (+73 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/save.rs` (+12 -11) 📝 `crates/horizon-client/src/structure_blocks.rs` (+61 -11) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent ([CC], deepseek-v4.1-flash), not by levzzz5154. ## What and why Fixes #1438. End city banners showed as plain magenta: a structure template saves a banner's layers in its block entity NBT (`patterns`), and `StructureTemplate.placeInWorld` hands that NBT to the level, where `BannerBlockEntity.loadAdditional` reads it. Horizon built the client block entity from the block alone (`BlockEntity::for_block`), which makes a banner with no layers, so every generated banner came out bare. `structure_blocks::generated_block_entity` now loads the banner's NBT the way it already did for spawners, trial spawners and vaults: `banner_from_nbt` reads `patterns`, `CustomName` and `components`, exactly the three things `BannerBlockEntity.loadAdditional`/`saveAdditional` carry. ## Vanilla reference - `BannerBlockEntity.loadAdditional` → `BannerPatternLayers.CODEC` on `patterns`, and `CustomName`. - `StructureTemplate.placeInWorld`: `this.setBlock(..., nbt, ...)` for every block that has one. - `data/minecraft/structure/end_city/tower_top.nbt`: eight `magenta_wall_banner` blocks whose NBT is `{patterns: [{pattern: "minecraft:triangle_top", color: "black"}, {pattern: "minecraft:triangle_bottom", color: "black"}], id: "minecraft:banner"}`. ## Test `a_generated_banner_keeps_its_template_patterns`: the tower top's two layers reach the block entity with their patterns and colour, and a banner saved without patterns stays bare. ## Scope One file, +78 −11. `cargo test -p horizon-client --lib structure_blocks` passes. 🤖 Generated with [[CC]](https://github.com/levzzz5154/horizon). ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on cachyos-x8664, against upstream/main at 7fd1f3118, 2 min 20 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +78 −11 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (4 s) | | clippy | ❌ failed (8 s) | | tests: horizon-client | ✅ 1243 passed (2 min 5 s) | | doc tests | ✅ 0 passed (1 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 269 affected, to run in CI (--quick) | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | `clippy` fails on `crates/horizon-client/src/mobs/axolotl.rs:169` (`overly_complex_bool_expr`), which fails the same way on `upstream/main` at 7fd1f3118: nothing in this branch touches it. 🤖 Generated with [[CC]](https://github.com/levzzz5154/horizon). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:12:55 +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#3871
No description provided.