[GH-ISSUE #7013] Server resource packs: a pack's blockstate file replaces vanilla's instead of stacking per state (CraftEngine packs fail with "unbound gallery block state") #3122

Closed
opened 2026-11-03 04:06:01 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @CalFishITA on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7013

Originally assigned to: @breachato on GitHub.

What happens

Joining a Paper server that runs CraftEngine (custom blocks and items), the server's resource pack downloads but is never applied, and it doesn't appear in the Resource Packs list. The log says:

[Render thread/WARN]: Horizon: server resource pack reload failed: unbound gallery block state

Hypixel SkyBlock's pack works on the same client. Reproduced on Nightly 2026-11-01 6f3d7b2 and c9d474d; first seen on a491181. Possibly one of the cases behind #3283.

Minimal reproduction (no server needed)

A two-file pack, used as a world's own pack (saves/<world>/resourcepacks/resources.zip, which goes through the same server-pack reload):

pack.mcmeta

{"pack":{"description":"Partial blockstate override","min_format":[97,1],"max_format":[97,1]}}

assets/minecraft/blockstates/oak_fence_gate.json

{"variants":{"facing=south,in_wall=false,open=false,powered=true":{"model":"minecraft:block/stone"}}}

Opening the world logs the warning above and the pack is not applied. The real CraftEngine pack (98 MB) with its 88 blockstates/*.json files removed loads and shows in the list.

Cause

  • CraftEngine's custom blocks reuse vanilla states that look the same as others (here oak_fence_gate with powered=true). Its pack ships blockstate files that define only those states: its oak_fence_gate.json holds just the 16 powered=true variants. It relies on vanilla reading a blockstate file as a resource stack: the definition from every pack that has the file is instantiated, bottom first, and a pack higher up replaces only the states it defines. Every other state keeps vanilla's model.
  • Horizon's overlay (horizon-client-render/src/packs.rs, build_overlay_uncached) stacks only lang, font, atlases and sounds.json (merge_kind). For a blockstate file the top pack's copy replaces vanilla's, and StateModels::from_facts_with_models (models/catalog.rs) binds that one file. Every state it doesn't cover stays unbound: with the pack above, every ordinary oak fence gate.
  • prepare_models (models.rs) looks up each GALLERY placement with catalog.collect(state, position)?. oak_fence_gate[facing=west,open=true] (powered=false) is unbound, so the ? fails the whole pack preparation and the server pack is dropped.
  • The mesher skips unbound states (models_at(..).is_err() → continue), so fixing only the gallery would load the pack but leave ordinary fence gates, doors, trapdoors, note blocks and the rest invisible.

The CraftEngine pack I tested overrides 88 blockstate files: doors, trapdoors, fence gates, saplings, leaves, note_block, mushroom blocks, tripwire, copper lanterns and chains, lightning rods, corals, kelp, vines, sugar_cane, cactus and a few slabs and stairs.

Suggested fix

  1. Keep the resource stack for assets/*/blockstates/*.json and bind each layer on its own, then give each state the topmost layer that binds it. Concatenating the files would not match vanilla, because BlockStateDefinition::bind follows vanilla's overlap rules within one file. In the catalog, one CompiledChoices per layer and states[id] = Some((choices.len(), selected)) for each layer from the bottom up fits the current structure.
  2. Make the gallery lookup non-fatal (skip the placement or use the missing model), as the mesher does, so one unbound state can't drop a whole pack.
Originally created by @CalFishITA on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7013 Originally assigned to: @breachato on GitHub. ## What happens Joining a Paper server that runs CraftEngine (custom blocks and items), the server's resource pack downloads but is never applied, and it doesn't appear in the Resource Packs list. The log says: ``` [Render thread/WARN]: Horizon: server resource pack reload failed: unbound gallery block state ``` Hypixel SkyBlock's pack works on the same client. Reproduced on Nightly 2026-11-01 `6f3d7b2` and `c9d474d`; first seen on `a491181`. Possibly one of the cases behind #3283. ## Minimal reproduction (no server needed) A two-file pack, used as a world's own pack (`saves/<world>/resourcepacks/resources.zip`, which goes through the same server-pack reload): `pack.mcmeta` ```json {"pack":{"description":"Partial blockstate override","min_format":[97,1],"max_format":[97,1]}} ``` `assets/minecraft/blockstates/oak_fence_gate.json` ```json {"variants":{"facing=south,in_wall=false,open=false,powered=true":{"model":"minecraft:block/stone"}}} ``` Opening the world logs the warning above and the pack is not applied. The real CraftEngine pack (98 MB) with its 88 `blockstates/*.json` files removed loads and shows in the list. ## Cause - CraftEngine's custom blocks reuse vanilla states that look the same as others (here `oak_fence_gate` with `powered=true`). Its pack ships blockstate files that define only those states: its `oak_fence_gate.json` holds just the 16 `powered=true` variants. It relies on vanilla reading a blockstate file as a resource stack: the definition from every pack that has the file is instantiated, bottom first, and a pack higher up replaces only the states it defines. Every other state keeps vanilla's model. - Horizon's overlay (`horizon-client-render/src/packs.rs`, `build_overlay_uncached`) stacks only `lang`, `font`, `atlases` and `sounds.json` (`merge_kind`). For a blockstate file the top pack's copy replaces vanilla's, and `StateModels::from_facts_with_models` (`models/catalog.rs`) binds that one file. Every state it doesn't cover stays unbound: with the pack above, every ordinary oak fence gate. - `prepare_models` (`models.rs`) looks up each `GALLERY` placement with `catalog.collect(state, position)?`. `oak_fence_gate[facing=west,open=true]` (`powered=false`) is unbound, so the `?` fails the whole pack preparation and the server pack is dropped. - The mesher skips unbound states (`models_at(..).is_err()` → `continue`), so fixing only the gallery would load the pack but leave ordinary fence gates, doors, trapdoors, note blocks and the rest invisible. The CraftEngine pack I tested overrides 88 blockstate files: doors, trapdoors, fence gates, saplings, leaves, `note_block`, mushroom blocks, `tripwire`, copper lanterns and chains, lightning rods, corals, `kelp`, vines, `sugar_cane`, `cactus` and a few slabs and stairs. ## Suggested fix 1. Keep the resource stack for `assets/*/blockstates/*.json` and bind each layer on its own, then give each state the topmost layer that binds it. Concatenating the files would not match vanilla, because `BlockStateDefinition::bind` follows vanilla's overlap rules within one file. In the catalog, one `CompiledChoices` per layer and `states[id] = Some((choices.len(), selected))` for each layer from the bottom up fits the current structure. 2. Make the gallery lookup non-fatal (skip the placement or use the missing model), as the mesher does, so one unbound state can't drop a whole pack.
Author
Owner

@breachato commented on GitHub (Nov 2, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6574780855 --> @breachato commented on GitHub (Nov 2, 2026): 🤖 Agent: /claim
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#3122
No description provided.