JFFL - 适用于 Forge 加载器的 Javassist 框架
JFFL 是一个基于 Javassist 的 Minecraft Forge 字节码操作库,提供类似 Mixin 的声明式补丁注入功能。它允许开发者使用注解在运行时修改 Minecraft 和其他模组中的类,而无需直接编写底层的 ASM 或 Javassist 代码。
特性
- 声明式注解驱动
- 回调处理器
- 映射重映射支持
- 灵活的注入点
安装与依赖
repositories {
// 将 JFFL mod 的 .jar 文件放入 libs 文件夹
flatDir {
dir 'libs'
}
}
// 在 dependencies 中写入(将 {versino} 替换为实际版本号):
dependencies {
implementation fg.deobf("wertygh:jffl:{version}")
}
与 Mixin 的关系
JFFL 并不是 Mixin 的替代品,而是提供了一种替代方案。两者可以共存,但不建议对同一个类同时应用两者,因为这可能会导致意外的冲突。JFFL 的优势包括:
- 轻量级,基于 Javassist 源代码级操作,更易于调试
- 支持动态注册回调而无需生成合成方法
开发与调试
在开发环境中(jffl.dev=true):
- JFFL 会输出详细日志
- 使用 @DumpClass 将修改后的类输出到 .jffl-dump 目录
- 支持直接使用 MCP/Mojang 名称,无需加载映射
许可证
BSD Zero Clause License
贡献与反馈
欢迎提交 Issue 和 Pull Request!
项目作者:wertygh
JFFL - Javassist Framework for Forge Loader
JFFL is a bytecode manipulation library for Minecraft Forge based on Javassist, providing Mixin-like declarative patch injection capabilities. It allows developers to modify classes from Minecraft and other mods at runtime using annotations, without the need to write low-level ASM or Javassist code directly.
Features
- Declarative Annotation-Driven
- Callback Handlers
- Mapping Remapping Support
- Flexible Injection Points
Installation and Dependencies
repositories {
// Put the .jar of JFFL mod into the libs folder
flatDir {
dir 'libs'
}
}
// Write in dependencies (replace {versino} with the actual version number):
dependencies {
implementation fg.deobf("wertygh:jffl:{version}")
}
Relationship with Mixin
JFFL is not a replacement for Mixin but rather provides an alternative option. Both can coexist, though applying both to the same class is not recommended as it may lead to unexpected conflicts. JFFL's advantages include:
- Lightweight, based on Javassist source-level operations, easier to debug
- Supports dynamic callback registration without generating synthetic methods
Development and Debugging
In development environment (jffl.dev=true):
- JFFL outputs detailed logs
- Use @DumpClass to output modified classes to the .jffl-dump directory
- Supports direct use of MCP/Mojang names without loading mappings
License
BSD Zero Clause License
Contribution and Feedback
Issues and Pull Requests are welcome!
Project author: wertygh
评论 0
登录后参与评分
还没有评论,来抢沙发吧