跳到正文

BlendIn

作者:Peak885

Fabric Mixin for Forge.

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

BlendIn

BOMBOCLAT

Forge 1.21.1 compatibility layer for Fabric’s maintained Sponge Mixin fork.

BlendIn lets Forge 1.21.1 projects use the maintained Fabric Sponge Mixin fork while keeping Forge’s normal ModLauncher environment.

What is BlendIn?

BlendIn is a Forge 1.21.1 mod and ModLauncher transformation service that integrates Fabric’s maintained Mixin implementation into Forge.

It handles the cursed runtime plumbing so developers don’t have to.

Forge 1.21.1
      │
      ▼
  ModLauncher
      │
      ▼
    BlendIn
      │
      ├── replaces the Mixin launch plugin
      ├── provides Fabric Sponge Mixin
      └── integrates it with Forge's secure module system

For developers

If your project needs Fabric Mixin’s APIs or annotations, use the Fabric Mixin fork as a compile-time-only dependency:

repositories {
    mavenCentral() //for fabric's mixin fork
    maven{ url "" rel="noopener nofollow" target="_blank">https://peaksuperior885.github.io/peaks_maven/files/" } //for blendin
}
dependencies {
    compileOnly "net.fabricmc:sponge-mixin:0.17.4+mixin.0.8.7"

    implementation "com.peak885:blendin:1.0.0-forge-1.21.1"
}

compileOnly is intentional. Your mod should not package another copy of Mixin. BlendIn provides the runtime implementation and handles the Forge/ModLauncher integration.

Supported environment

Component Version
Minecraft 1.21.1
Forge 52.x
Java 21
Fabric Sponge Mixin 0.17.4 + Mixin 0.8.7

BlendIn is currently intended specifically for Forge 1.21.1.

How it works

During ModLauncher startup, BlendIn registers its transformation service and replaces the existing Mixin module with the bundled Fabric Mixin implementation.

It also integrates the replacement module with Forge’s secure module/class-loader system and handles package signer state when necessary.

In other words:

You write the mod — BlendIn deals with the JVM wizardry.

And yes, the JVM wizardry was significantly more annoying than expected.

Status

BlendIn is currently on Release stage 😊.

The project has successfully demonstrated:

  • ModLauncher transformation-service registration
  • Replacement of Forge’s Mixin launch-plugin implementation
  • Fabric Mixin 0.8.7 initialization
  • Injection of the Fabric Mixin module into Forge’s secure module system
  • Handling of package signer information during Mixin replacement
  • Loading Fabric Mixin directly from the bundled JAR

Real-world mod and Mixin compatibility testing is still recommended before using BlendIn in a large production environment.

Credits

BlendIn uses:

Fabric Sponge Mixin

net.fabricmc:sponge-mixin:0.17.4+mixin.0.8.7

Parts of BlendIn’s runtime integration were adapted from MixinTransmogrifier by Sinytra and its contributors.

Please see the relevant upstream project and licenses for attribution and licensing information.

License

BlendIn is licensed under PGCL-1.0 — Peak’s General Cave License v1.0.

See LICENSE.txt for the complete license.

🗿 The Rock has veto power.

Contributing

Found a problem or compatibility issue?

Open an issue with:

  • Minecraft version
  • Forge version
  • BlendIn version
  • Java version
  • Relevant mods
  • Full error log

Please include enough information to reproduce the issue.

If the public API doesn’t provide what you need, open an issue before reaching for ASM.

Seriously.


Why does this exist?

Forge’s Mixin implementation is no longer where BlendIn needs it to be, while Fabric’s maintained Sponge Mixin fork provides functionality that Forge’s bundled implementation does not.

So naturally, the completely reasonable solution was to replace Mixin during ModLauncher startup, integrate a different Mixin module into Forge’s secure module system, deal with JVM package signer state, and somehow make the whole thing work.

It works.

We aren’t going to question it.

The important questions

Does it work?

Yes.

Should it exist?

Probably.

Was it a massive pain in the ass?

Absolutely.

Would we do it again?

…probably.

🪨 Approved by The Rock.


Made by Peak885.

🪨 Approved by The Rock.

常见问题

BlendIn 支持哪些 Minecraft 版本?

BlendIn 支持 Minecraft Java 版 1.21.1,可用的加载器:Forge。下载时注意选择和你游戏版本一致的文件。

BlendIn 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Forge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。

评论

登录后评论和评分

Peak885 的其他作品

查看全部 →