[PR #5088] [CLOSED] Add Fabric compatibility layer (WIP) #6066

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5088
Author: @melthedevv
Created: 10/31/2026
Status: ❌ Closed

Base: main ← Head: main


📝 Commits (3)

  • 46169f0 Upload Sat 10/31/2026 12:53:11.55
  • 47913ea Upload Sat 10/31/2026 12:54:10.03
  • ccb6f17 Remove upload script

📊 Changes

39 files changed (+5900 additions, -215 deletions)

View changed files

📝 Cargo.lock (+514 -215)
📝 Cargo.toml (+6 -0)
➕ crates/horizon-fabric-api/Cargo.toml (+13 -0)
➕ crates/horizon-fabric-api/src/events.rs (+162 -0)
➕ crates/horizon-fabric-api/src/lib.rs (+151 -0)
➕ crates/horizon-fabric-api/src/networking.rs (+93 -0)
➕ crates/horizon-fabric-api/src/registry.rs (+180 -0)
➕ crates/horizon-fabric-api/tests/api_surface.rs (+76 -0)
➕ crates/horizon-fabric-integration/Cargo.toml (+29 -0)
➕ crates/horizon-fabric-integration/examples/debug_classpath.rs (+38 -0)
➕ crates/horizon-fabric-integration/examples/run_mod.rs (+59 -0)
➕ crates/horizon-fabric-integration/src/lib.rs (+187 -0)
➕ crates/horizon-fabric-jni/Cargo.toml (+19 -0)
➕ crates/horizon-fabric-jni/src/lib.rs (+294 -0)
➕ crates/horizon-fabric-jvm/Cargo.toml (+20 -0)
➕ crates/horizon-fabric-jvm/examples/smoke.rs (+50 -0)
➕ crates/horizon-fabric-jvm/src/class_loader.rs (+345 -0)
➕ crates/horizon-fabric-jvm/src/jni_bridge.rs (+394 -0)
➕ crates/horizon-fabric-jvm/src/jvm_args.rs (+220 -0)
➕ crates/horizon-fabric-jvm/src/lib.rs (+259 -0)

...and 19 more files

📄 Description

What and why

Work in progress: this is still under development and I'm actively working on it. Opening it as a draft so the structure can be reviewed early.

Adds a Fabric compatibility layer so Fabric mods can run on Horizon. It's split into seven crates:

  • horizon-fabric-jvm: embeds a JVM through the JNI invocation API, JVM args and the Fabric class loader
  • horizon-fabric-jni: JNI bridge (class lookup, instantiation, method calls, exception handling)
  • horizon-fabric-loader: reads fabric.mod.json, resolves dependencies, runs entrypoints, reads mixin configs
  • horizon-fabric-mixin: mixin config types and injection point definitions
  • horizon-fabric-mapping: Yarn and Horizon name mapping layer
  • horizon-fabric-api: Rust-side event bus, registries and networking channels
  • horizon-fabric-integration: wires the JVM, loader and API together, plus run_mod and debug_classpath examples

Current limits:

  • Mods that call net.minecraft.* need Minecraft's Java classes on the classpath, which Horizon doesn't ship. Right now only mods that stay inside their own classes and Fabric API can run end to end.
  • Mixin transformation is a passthrough. Configs are parsed, but no bytecode is changed yet.
  • The embedded Yarn 26.3 mapping file is a placeholder with no entries.

Still to do: real mixin transformation, real Yarn data, more Fabric API surface.

Kind

  • feature: something new for players (listed under New in the release notes)

Vanilla reference

Horizon-only. Vanilla has no Fabric support. Checked by crates/horizon-fabric-loader/tests/mod_loading.rs and crates/horizon-fabric-api/tests/api_surface.rs, plus the run_mod example in horizon-fabric-integration.

Other projects' code

none. Class and method names in the mapping layer follow Yarn naming (CC0-1.0), and fabric.mod.json and mixin config parsing follow the public Fabric and Mixin formats. No code was copied from other projects.

Self-check

<paste the output of python tools/pr_ready.py --base upstream/main here>

Screenshots

n/a, no player-visible changes yet.


🔄 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/5088 **Author:** [@melthedevv](https://github.com/melthedevv) **Created:** 10/31/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (3) - [`46169f0`](https://github.com/horizon-rust/horizon/commit/46169f088a69b51053a5cf1eded0616323b98ced) Upload Sat 10/31/2026 12:53:11.55 - [`47913ea`](https://github.com/horizon-rust/horizon/commit/47913ea3ebfebe2b38c4ea9f85b2728962472406) Upload Sat 10/31/2026 12:54:10.03 - [`ccb6f17`](https://github.com/horizon-rust/horizon/commit/ccb6f172f82104530b2803d0e6a914826e7aa2a5) Remove upload script ### 📊 Changes **39 files changed** (+5900 additions, -215 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+514 -215) 📝 `Cargo.toml` (+6 -0) ➕ `crates/horizon-fabric-api/Cargo.toml` (+13 -0) ➕ `crates/horizon-fabric-api/src/events.rs` (+162 -0) ➕ `crates/horizon-fabric-api/src/lib.rs` (+151 -0) ➕ `crates/horizon-fabric-api/src/networking.rs` (+93 -0) ➕ `crates/horizon-fabric-api/src/registry.rs` (+180 -0) ➕ `crates/horizon-fabric-api/tests/api_surface.rs` (+76 -0) ➕ `crates/horizon-fabric-integration/Cargo.toml` (+29 -0) ➕ `crates/horizon-fabric-integration/examples/debug_classpath.rs` (+38 -0) ➕ `crates/horizon-fabric-integration/examples/run_mod.rs` (+59 -0) ➕ `crates/horizon-fabric-integration/src/lib.rs` (+187 -0) ➕ `crates/horizon-fabric-jni/Cargo.toml` (+19 -0) ➕ `crates/horizon-fabric-jni/src/lib.rs` (+294 -0) ➕ `crates/horizon-fabric-jvm/Cargo.toml` (+20 -0) ➕ `crates/horizon-fabric-jvm/examples/smoke.rs` (+50 -0) ➕ `crates/horizon-fabric-jvm/src/class_loader.rs` (+345 -0) ➕ `crates/horizon-fabric-jvm/src/jni_bridge.rs` (+394 -0) ➕ `crates/horizon-fabric-jvm/src/jvm_args.rs` (+220 -0) ➕ `crates/horizon-fabric-jvm/src/lib.rs` (+259 -0) _...and 19 more files_ </details> ### 📄 Description ## What and why Work in progress: this is still under development and I'm actively working on it. Opening it as a draft so the structure can be reviewed early. Adds a Fabric compatibility layer so Fabric mods can run on Horizon. It's split into seven crates: - `horizon-fabric-jvm`: embeds a JVM through the JNI invocation API, JVM args and the Fabric class loader - `horizon-fabric-jni`: JNI bridge (class lookup, instantiation, method calls, exception handling) - `horizon-fabric-loader`: reads `fabric.mod.json`, resolves dependencies, runs entrypoints, reads mixin configs - `horizon-fabric-mixin`: mixin config types and injection point definitions - `horizon-fabric-mapping`: Yarn and Horizon name mapping layer - `horizon-fabric-api`: Rust-side event bus, registries and networking channels - `horizon-fabric-integration`: wires the JVM, loader and API together, plus `run_mod` and `debug_classpath` examples Current limits: - Mods that call `net.minecraft.*` need Minecraft's Java classes on the classpath, which Horizon doesn't ship. Right now only mods that stay inside their own classes and Fabric API can run end to end. - Mixin transformation is a passthrough. Configs are parsed, but no bytecode is changed yet. - The embedded Yarn 26.3 mapping file is a placeholder with no entries. Still to do: real mixin transformation, real Yarn data, more Fabric API surface. ## Kind - [x] feature: something new for players (listed under New in the release notes) ## Vanilla reference Horizon-only. Vanilla has no Fabric support. Checked by `crates/horizon-fabric-loader/tests/mod_loading.rs` and `crates/horizon-fabric-api/tests/api_surface.rs`, plus the `run_mod` example in `horizon-fabric-integration`. ## Other projects' code none. Class and method names in the mapping layer follow Yarn naming (CC0-1.0), and `fabric.mod.json` and mixin config parsing follow the public Fabric and Mixin formats. No code was copied from other projects. ## Self-check <paste the output of `python tools/pr_ready.py --base upstream/main` here> ## Screenshots n/a, no player-visible changes yet. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:11:21 +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#6066
No description provided.