[PR #7867] Content blocks choose their render_shape #7871

Open
opened 2026-11-03 07:25:47 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7867
Author: @OlaHulleberg
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: content/render-shape


📝 Commits (1)

  • bb5c43d Content blocks choose their render_shape

📊 Changes

4 files changed (+66 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/mod_content.rs (+3 -0)
📝 crates/horizon-client/src/mod_content_tests.rs (+11 -1)
📝 crates/horizon-mods/src/content.rs (+46 -0)
📝 docs/mods.md (+6 -0)

📄 Description

🤖 Opened by OlaHulleberg's AI agent (Claude Code, Claude Opus 5.5), not by OlaHulleberg personally.

What and why

Item 1 of #5550 (agreed with @JuanLuci there). A content block always drew as its template does, so a block whose moving parts its block entity draws every frame (a turning shaft, a machine's arm) still had its model baked into the chunk mesh. BlockProperties refuses unknown keys, so there was no way to say otherwise.

properties.render_shape takes vanilla's RenderShape by name, as #5550 proposes: "MODEL", "ENTITYBLOCK_ANIMATED" (the model is left out of the chunk mesh) or "INVISIBLE". It sets the state's render_shape in the gameplay table, which the mesher already reads, the same way random_ticks (#6138) sets its flag. Outline, collision, light and occlusion are unchanged; the docs say so, since a block on an occluding template (stone) still hides the faces it covers. Item 2's occludes switch is for that, after #7557.

  • crates/horizon-mods/src/content.rs: the key and the enum (only vanilla's constant names are accepted).
  • crates/horizon-client/src/mod_content.rs: one line in override_gameplay.
  • Tests: the parser accepts the three names and refuses others; the content-root test's glass gets ENTITYBLOCK_ANIMATED while the iron-template block keeps MODEL. It fails without the change (left: Model, right: Animated).
  • docs/mods.md: a paragraph after random_ticks.

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

BlockBehaviour.getRenderShape / RenderShape (MODEL, ENTITYBLOCK_ANIMATED, INVISIBLE); the content key itself is Horizon-only.

Other projects' code

None.

Self-check

pr_ready (tools/pr_ready.py on sbx-create-port, against origin/main at 0bcd2f156, 53 min 12 s)

Check Result
Scope ✅ 5 files, +66 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 614 passed (41 s)
rustfmt ✅ (11 s)
clippy ✅ (1 min 57 s)
tests: horizon-client-lib, horizon-mods ✅ 1531 passed (5 min 36 s)
doc tests ✅ 0 passed (2 s)
content root tests ✅ 24 passed (1 min 26 s)
mod API up to date ➖ native hooks untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (1 s)
launcher clippy ❌ failed (17 s)
launcher tests ❌ failed (18 s)
Parity ❌ 390 affected, 2 passed, 388 failed in this sandbox (see below) (42 min 42 s)
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Not green here, and why (not a claim that they pass):

  • Parity: the 388 failures here come from the sandbox, not the change. I read every log: most can't build or find their vanilla oracles because there is no JDK (FileNotFoundError: ... 'javac' / 'java', keytool, or a SKIP for missing oracle results); the ones that open a game exit at winit's "neither WAYLAND_DISPLAY nor ... DISPLAY" (no display server under pr_ready; the same launch run by hand without a display exits the same way); and the rest stop at ValueError: ... is not in the subpath of ... because my .local is a link to the prepared resources in another checkout. None reaches content loading. CI's parity job runs them properly.
  • Launcher clippy and tests: the system fontconfig library isn't installed here (yeslogic-fontconfig-sys build script). The launcher is untouched.
  • Scope counts an untracked .local link to the prepared resources; the change itself is 4 files, +66 −1.

Also run: cargo test -p horizon-client-lib --lib mod_content::tests::content_root_loads_with_every_table -- --ignored (passes; fails with the one-line change reverted).

In game

Five blocks from a test content mod, side by side: stone-template MODEL, ENTITYBLOCK_ANIMATED and INVISIBLE, and glass-template MODEL and ENTITYBLOCK_ANIMATED. Headless on an Intel Arc (BMG G21), on the single-player server thread and on a dedicated server (--dev-mod on both sides) with a client joined and the blocks set from the server console. Both show the same thing: the two MODEL blocks are drawn; the ENTITYBLOCK_ANIMATED and INVISIBLE ones aren't. Under the stone-template ones the planks' top face stays culled, because stone still occludes (unchanged, as above).

Single player (server thread) Dedicated server, joined client
server thread dedicated server

🤖 Generated with Claude Code


🔄 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/7867 **Author:** [@OlaHulleberg](https://github.com/OlaHulleberg) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `content/render-shape` --- ### 📝 Commits (1) - [`bb5c43d`](https://github.com/horizon-rust/horizon/commit/bb5c43d6029ab0208eef231f384e0981b97c9ee7) Content blocks choose their render_shape ### 📊 Changes **4 files changed** (+66 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mod_content.rs` (+3 -0) 📝 `crates/horizon-client/src/mod_content_tests.rs` (+11 -1) 📝 `crates/horizon-mods/src/content.rs` (+46 -0) 📝 `docs/mods.md` (+6 -0) </details> ### 📄 Description > 🤖 Opened by OlaHulleberg's AI agent (Claude Code, Claude Opus 5.5), not by OlaHulleberg personally. ## What and why Item 1 of #5550 (agreed with @JuanLuci there). A content block always drew as its template does, so a block whose moving parts its block entity draws every frame (a turning shaft, a machine's arm) still had its model baked into the chunk mesh. `BlockProperties` refuses unknown keys, so there was no way to say otherwise. `properties.render_shape` takes vanilla's `RenderShape` by name, as #5550 proposes: `"MODEL"`, `"ENTITYBLOCK_ANIMATED"` (the model is left out of the chunk mesh) or `"INVISIBLE"`. It sets the state's `render_shape` in the gameplay table, which the mesher already reads, the same way `random_ticks` (#6138) sets its flag. Outline, collision, light and occlusion are unchanged; the docs say so, since a block on an occluding template (stone) still hides the faces it covers. Item 2's `occludes` switch is for that, after #7557. - `crates/horizon-mods/src/content.rs`: the key and the enum (only vanilla's constant names are accepted). - `crates/horizon-client/src/mod_content.rs`: one line in `override_gameplay`. - Tests: the parser accepts the three names and refuses others; the content-root test's glass gets `ENTITYBLOCK_ANIMATED` while the iron-template block keeps `MODEL`. It fails without the change (`left: Model, right: Animated`). - `docs/mods.md`: a paragraph after `random_ticks`. ## 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 `BlockBehaviour.getRenderShape` / `RenderShape` (`MODEL`, `ENTITYBLOCK_ANIMATED`, `INVISIBLE`); the content key itself is Horizon-only. ## Other projects' code None. ## Self-check **pr_ready** (`tools/pr_ready.py` on sbx-create-port, against origin/main at 0bcd2f156, 53 min 12 s) | Check | Result | | --- | --- | | Scope | ✅ 5 files, +66 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 614 passed (41 s) | | rustfmt | ✅ (11 s) | | clippy | ✅ (1 min 57 s) | | tests: horizon-client-lib, horizon-mods | ✅ 1531 passed (5 min 36 s) | | doc tests | ✅ 0 passed (2 s) | | content root tests | ✅ 24 passed (1 min 26 s) | | mod API up to date | ➖ native hooks untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (1 s) | | launcher clippy | ❌ failed (17 s) | | launcher tests | ❌ failed (18 s) | | Parity | ❌ 390 affected, 2 passed, 388 failed in this sandbox (see below) (42 min 42 s) | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Not green here, and why (not a claim that they pass): - **Parity:** the 388 failures here come from the sandbox, not the change. I read every log: most can't build or find their vanilla oracles because there is no JDK (`FileNotFoundError: ... 'javac'` / `'java'`, `keytool`, or a SKIP for missing oracle results); the ones that open a game exit at winit's "neither WAYLAND_DISPLAY nor ... DISPLAY" (no display server under `pr_ready`; the same launch run by hand without a display exits the same way); and the rest stop at `ValueError: ... is not in the subpath of ...` because my `.local` is a link to the prepared resources in another checkout. None reaches content loading. CI's parity job runs them properly. - **Launcher clippy and tests:** the system `fontconfig` library isn't installed here (`yeslogic-fontconfig-sys` build script). The launcher is untouched. - **Scope** counts an untracked `.local` link to the prepared resources; the change itself is 4 files, +66 −1. Also run: `cargo test -p horizon-client-lib --lib mod_content::tests::content_root_loads_with_every_table -- --ignored` (passes; fails with the one-line change reverted). ## In game Five blocks from a test content mod, side by side: stone-template `MODEL`, `ENTITYBLOCK_ANIMATED` and `INVISIBLE`, and glass-template `MODEL` and `ENTITYBLOCK_ANIMATED`. Headless on an Intel Arc (BMG G21), on the single-player server thread and on a dedicated server (`--dev-mod` on both sides) with a client joined and the blocks set from the server console. Both show the same thing: the two `MODEL` blocks are drawn; the `ENTITYBLOCK_ANIMATED` and `INVISIBLE` ones aren't. Under the stone-template ones the planks' top face stays culled, because stone still occludes (unchanged, as above). | Single player (server thread) | Dedicated server, joined client | |---|---| | ![server thread](https://raw.githubusercontent.com/OlaHulleberg/horizon/media/render-shape/render-shape/server-thread.png) | ![dedicated server](https://raw.githubusercontent.com/OlaHulleberg/horizon/media/render-shape/render-shape/dedicated-client.png) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#7871
No description provided.