[PR #5574] [MERGED] OptiFine packs: a shared reader for their .properties, matchers and paths #6363

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

📋 Pull Request Information

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

Base: main ← Head: optifine/properties


📝 Commits (2)

  • d253b46 OptiFine packs: a shared reader for their .properties, matchers and paths
  • cb9e499 OptiFine reader: paths stay in the root, linear globs, no link loops

📊 Changes

7 files changed (+655 additions, -0 deletions)

View changed files

📝 Cargo.lock (+7 -0)
📝 Cargo.toml (+1 -0)
➕ crates/horizon-optifine/Cargo.toml (+13 -0)
➕ crates/horizon-optifine/src/lib.rs (+14 -0)
➕ crates/horizon-optifine/src/matchers.rs (+293 -0)
➕ crates/horizon-optifine/src/paths.rs (+180 -0)
➕ crates/horizon-optifine/src/properties.rs (+147 -0)

📄 Description

Resource packs built for OptiFine and its Fabric ports (Continuity, CIT Resewn, Entity Texture/Model Features) do nothing in Horizon yet: connected textures, custom item textures, random and emissive mobs and custom entity models are all ignored. Every one of those features keeps its rules in the same kind of file, so this PR adds that shared layer first. The features themselves come in follow-up PRs built on it.

New crate horizon-optifine (no dependents yet, so players see no change):

  • properties: Java .properties as OptiFine loads them: =, : or space separators, #/! comments, \ continuations, \uXXXX and the other escapes, trimmed values, last duplicate wins. The shader-pack reader in horizon-shaders isn't reused because it runs #define/#if and reads no escapes.
  • matchers: names (pattern:, ipattern:, regex:, iregex:, exact; regexes match the whole name like Java's String.matches), range lists (1 3-5 8- (-64)-0), id lists with ! exclusions, and block lists with states (oak_log:axis=x,z; legacy numeric ids dropped).
  • paths: OptiFine path resolution (~/, ./, bare names beside the file, namespace:path), plus every .properties under assets/*/optifine/<feature> and the legacy mcpatcher/ folder of the overlay resource root.

Sources: OptiFine's public format documentation only. No mod source was read (OptiFine is all rights reserved, and the Fabric ports are LGPL).

Checks: cargo test -p horizon-optifine (9 pass) and cargo clippy -p horizon-optifine --all-targets -- -D warnings are clean. pr_ready.py --quick: public tree, Python tests and rustfmt passed. Its workspace-wide clippy hit my 30-minute limit on a shared, busy machine; nothing in the workspace depends on the new crate, and CI runs it.

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/5574 **Author:** [@some-du6e](https://github.com/some-du6e) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `optifine/properties` --- ### 📝 Commits (2) - [`d253b46`](https://github.com/horizon-rust/horizon/commit/d253b46872fe96b8cf4b84062cf573b6d75377c6) OptiFine packs: a shared reader for their .properties, matchers and paths - [`cb9e499`](https://github.com/horizon-rust/horizon/commit/cb9e4996d321e94993676277843fa537e0ea6f1b) OptiFine reader: paths stay in the root, linear globs, no link loops ### 📊 Changes **7 files changed** (+655 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+7 -0) 📝 `Cargo.toml` (+1 -0) ➕ `crates/horizon-optifine/Cargo.toml` (+13 -0) ➕ `crates/horizon-optifine/src/lib.rs` (+14 -0) ➕ `crates/horizon-optifine/src/matchers.rs` (+293 -0) ➕ `crates/horizon-optifine/src/paths.rs` (+180 -0) ➕ `crates/horizon-optifine/src/properties.rs` (+147 -0) </details> ### 📄 Description Resource packs built for OptiFine and its Fabric ports (Continuity, CIT Resewn, Entity Texture/Model Features) do nothing in Horizon yet: connected textures, custom item textures, random and emissive mobs and custom entity models are all ignored. Every one of those features keeps its rules in the same kind of file, so this PR adds that shared layer first. The features themselves come in follow-up PRs built on it. New crate `horizon-optifine` (no dependents yet, so players see no change): - `properties`: Java `.properties` as OptiFine loads them: `=`, `:` or space separators, `#`/`!` comments, `\` continuations, `\uXXXX` and the other escapes, trimmed values, last duplicate wins. The shader-pack reader in `horizon-shaders` isn't reused because it runs `#define`/`#if` and reads no escapes. - `matchers`: names (`pattern:`, `ipattern:`, `regex:`, `iregex:`, exact; regexes match the whole name like Java's `String.matches`), range lists (`1 3-5 8- (-64)-0`), id lists with `!` exclusions, and block lists with states (`oak_log:axis=x,z`; legacy numeric ids dropped). - `paths`: OptiFine path resolution (`~/`, `./`, bare names beside the file, `namespace:path`), plus every `.properties` under `assets/*/optifine/<feature>` and the legacy `mcpatcher/` folder of the overlay resource root. Sources: OptiFine's public format documentation only. No mod source was read (OptiFine is all rights reserved, and the Fabric ports are LGPL). Checks: `cargo test -p horizon-optifine` (9 pass) and `cargo clippy -p horizon-optifine --all-targets -- -D warnings` are clean. `pr_ready.py --quick`: public tree, Python tests and rustfmt passed. Its workspace-wide clippy hit my 30-minute limit on a shared, busy machine; nothing in the workspace depends on the new crate, and CI runs it. > [!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:19:14 +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#6363
No description provided.