[PR #6590] [MERGED] Fusion packs: connection predicates #6968

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6590
Author: @some-du6e
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: optifine/fusion-predicates


📝 Commits (10+)

  • 4fbeab0 Fusion packs: which tiles of a connecting texture a face draws
  • daa63d0 Fusion layouts: pin more template tiles, and one rule for rows and columns
  • 9cc9df1 Fusion layouts: credit the FusionExamples templates, and say where each layout comes from
  • 1a54e1c Fusion layouts: overlay corners join two sides into one piece
  • 2fb130b Fusion layouts: say which overlay test pins a guess
  • 442ac7a Fusion layouts: clippy's identity_op in a test
  • d7896df Fusion packs: connection predicates
  • e440012 Fusion predicates: test every direction name and state values
  • 574d9b1 Fusion predicates: name the field a bad block list came from
  • 383eea6 Fusion predicates: clippy's identity_op in a test

📊 Changes

7 files changed (+813 additions, -4 deletions)

View changed files

📝 THIRD_PARTY_NOTICES.md (+24 -0)
📝 crates/horizon-optifine/Cargo.toml (+1 -1)
📝 crates/horizon-optifine/src/ctm/connect.rs (+1 -1)
➕ crates/horizon-optifine/src/fusion.rs (+34 -0)
➕ crates/horizon-optifine/src/fusion/layout.rs (+399 -0)
➕ crates/horizon-optifine/src/fusion/predicate.rs (+349 -0)
📝 crates/horizon-optifine/src/lib.rs (+5 -2)

📄 Description

Fusion's connecting textures decide whether to join a neighbour in each of a face's eight directions through connection predicates: is_same_block, is_same_state, match_block, match_state, match_block_in_front, match_state_in_front, is_direction, is_face_visible, and, or, not, true and false. Block Transitions, for example, joins a grass edge toward sand only where the sand's face shows. Horizon has to read these before it can draw any Fusion pack. Second PR of the Fusion stack; depends on #6588 (its commit is included here).

What I did. fusion::Connection parses every predicate on the wiki's Connecting Texture Type page, with block lists as the existing BlockMatch (state properties take one value or an array). A bare array means any of its predicates. The block lists are a type parameter: map_blocks lets the game swap names for the state-id sets it builds once at load. joins/mask evaluate a predicate per direction and give back a ctm::connect mask. The world only answers the leaf tests (same block, neighbour matches, in front matches, face visible), and and/or stop early, so a face never asks for more than its predicate needs.

Players see no change yet. Next: texture .mcmeta sections, connecting models, then the mesher seam.

Docs used. Fusion is All Rights Reserved (its Modrinth license), so I read none of its code. I worked from its public GitHub wiki's Connecting Texture Type page (the connection predicates list and its examples). The official Fusion Connected Glass and Block Transitions packs showed the spellings packs actually use (fusion:or, fusion:is_same_block), so the parser accepts the fusion: namespace. None of their files are committed.

Checks. cargo fmt and cargo test -p horizon-optifine --lib fusion locally (the one quick test the shared machine's rules allow). The workspace clippy and test run is on my fork's CI for the tip of the stack: https://github.com/some-du6e/horizon/actions/runs/41366109977. No .local vanilla data on this machine, so no harnesses, and the review loop's live game test was skipped: nothing here is drawn yet. Reviewed in three rounds of fresh reviewers. Round 1 found a missing type that Fusion Emissive Ores relies on, plus weak test coverage. Round 2 found that overlay corners join two sides into one piece. Round 3 was clean.

Note

Filed by Opus 5.5 using 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/6590 **Author:** [@some-du6e](https://github.com/some-du6e) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `optifine/fusion-predicates` --- ### 📝 Commits (10+) - [`4fbeab0`](https://github.com/horizon-rust/horizon/commit/4fbeab00aec9beaae1b3e7d6c342f4e7ae749215) Fusion packs: which tiles of a connecting texture a face draws - [`daa63d0`](https://github.com/horizon-rust/horizon/commit/daa63d0fa7c628a53cba2e3bcfdd151b6e472cb2) Fusion layouts: pin more template tiles, and one rule for rows and columns - [`9cc9df1`](https://github.com/horizon-rust/horizon/commit/9cc9df16b4d99d6c3bbb94e77755be0041c93fd6) Fusion layouts: credit the FusionExamples templates, and say where each layout comes from - [`1a54e1c`](https://github.com/horizon-rust/horizon/commit/1a54e1cc56134c554564eafa848fb37f88348016) Fusion layouts: overlay corners join two sides into one piece - [`2fb130b`](https://github.com/horizon-rust/horizon/commit/2fb130b16cb90424737d0e72e0716e8011101af9) Fusion layouts: say which overlay test pins a guess - [`442ac7a`](https://github.com/horizon-rust/horizon/commit/442ac7ab418663c806f9df196a611c93639e6b1e) Fusion layouts: clippy's identity_op in a test - [`d7896df`](https://github.com/horizon-rust/horizon/commit/d7896df7d8ea9cc25829d348f9b065406deb1623) Fusion packs: connection predicates - [`e440012`](https://github.com/horizon-rust/horizon/commit/e440012293655f43c6d1373c7e4bb94bd71173be) Fusion predicates: test every direction name and state values - [`574d9b1`](https://github.com/horizon-rust/horizon/commit/574d9b148e75278797a74a13b26452816960d04c) Fusion predicates: name the field a bad block list came from - [`383eea6`](https://github.com/horizon-rust/horizon/commit/383eea634de36c12e8884a07aaf61ffe6c539599) Fusion predicates: clippy's identity_op in a test ### 📊 Changes **7 files changed** (+813 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `THIRD_PARTY_NOTICES.md` (+24 -0) 📝 `crates/horizon-optifine/Cargo.toml` (+1 -1) 📝 `crates/horizon-optifine/src/ctm/connect.rs` (+1 -1) ➕ `crates/horizon-optifine/src/fusion.rs` (+34 -0) ➕ `crates/horizon-optifine/src/fusion/layout.rs` (+399 -0) ➕ `crates/horizon-optifine/src/fusion/predicate.rs` (+349 -0) 📝 `crates/horizon-optifine/src/lib.rs` (+5 -2) </details> ### 📄 Description Fusion's connecting textures decide whether to join a neighbour in each of a face's eight directions through *connection predicates*: `is_same_block`, `is_same_state`, `match_block`, `match_state`, `match_block_in_front`, `match_state_in_front`, `is_direction`, `is_face_visible`, `and`, `or`, `not`, `true` and `false`. Block Transitions, for example, joins a grass edge toward sand only where the sand's face shows. Horizon has to read these before it can draw any Fusion pack. Second PR of the Fusion stack; depends on #6588 (its commit is included here). **What I did.** `fusion::Connection` parses every predicate on the wiki's Connecting Texture Type page, with block lists as the existing `BlockMatch` (state properties take one value or an array). A bare array means any of its predicates. The block lists are a type parameter: `map_blocks` lets the game swap names for the state-id sets it builds once at load. `joins`/`mask` evaluate a predicate per direction and give back a `ctm::connect` mask. The world only answers the leaf tests (same block, neighbour matches, in front matches, face visible), and `and`/`or` stop early, so a face never asks for more than its predicate needs. Players see no change yet. Next: texture `.mcmeta` sections, connecting models, then the mesher seam. **Docs used.** Fusion is All Rights Reserved (its Modrinth license), so I read none of its code. I worked from its public GitHub wiki's Connecting Texture Type page (the connection predicates list and its examples). The official Fusion Connected Glass and Block Transitions packs showed the spellings packs actually use (`fusion:or`, `fusion:is_same_block`), so the parser accepts the `fusion:` namespace. None of their files are committed. **Checks.** `cargo fmt` and `cargo test -p horizon-optifine --lib fusion` locally (the one quick test the shared machine's rules allow). The workspace clippy and test run is on my fork's CI for the tip of the stack: https://github.com/some-du6e/horizon/actions/runs/41366109977. No `.local` vanilla data on this machine, so no harnesses, and the review loop's live game test was skipped: nothing here is drawn yet. Reviewed in three rounds of fresh reviewers. Round 1 found a missing `type` that Fusion Emissive Ores relies on, plus weak test coverage. Round 2 found that `overlay` corners join two sides into one piece. Round 3 was clean. > [!NOTE] > Filed by Opus 5.5 using Claude Code. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:30:26 +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#6968
No description provided.