FoamFix
[!INFO] Git Commit: 见 relation.md | Minecraft 1.7.10 / Forge 10.13.4.1614-1.7.10
内存与稳定性优化 coremod。由 BugfixMod(williewillus)、Forkage(immibis) 与 FoamFix(asie)三条补丁线合并重打包而成。
简介
FoamFix(modid foamfix)是 1.7.10 的 coremod,同时是普通 mod:
- 25 个字节码补丁(ASM tree API),全部由一个
IClassTransformer登记。 @Mod无dependencies字段 —— 不声明任何 mod 依赖。- JndiLookup 三重探测修复 Log4Shell;另有 BiblioRCE 修复。
- 重打包 80 个文件的 Ears,提供 1.8+ 皮肤支持(体量最大子系统)。
- 8 个客户端/服务端补丁会在专用服务器上被强制关闭并落盘。
版本与标识
| 项 | 值 | 来源 |
|---|---|---|
| modid | foamfix |
@Mod(modid = "foamfix") |
| name | FoamFix |
@Mod(name = "FoamFix") |
| 版本 | 1.0.3 |
build.properties: mod_version |
| MC | 1.7.10 |
build.properties: minecraft_version |
| Forge | 10.13.4.1614-1.7.10 |
build.properties: forge_version |
@Mod version |
"@VERSION@" |
构建期占位符,源码读不到 |
⚠️
build.properties里写的是mod_id=FoamFix(首字母大写), 而@Mod注解与 mcmod.info 都是全小写foamfix。以@Mod为准。 分类名foamfix17的17来自仓库名FoamFix17,不属于 modid。 MC 版本只存在于build.properties(gradle.properties为空)。
概念总览
| 概念 | 摘要 | 关联条目 |
|---|---|---|
| 加载插件 | IFMLLoadingPlugin,SortingIndex 1001 |
FoamFix Core |
| 补丁注册真源 | 25 个实例,三道条件闸门 | BugfixMod Class Transformer |
| 补丁基类 | 3 种注入模式 + 哨兵写法 | Abstract Patcher |
| 映射表 | MCP ↔ SRG,仅混淆时填充 | Mapping Registry |
| 配置 | foamfix.cfg,28 个键 |
BugfixMod Settings |
Coremod 列表
- FoamFix Core —
@IFMLLoadingPlugin,SortingIndex 1001,TransformerExclusions 排除自身包 - FoamFix Core Container —
DummyModContainer兜底 - BugfixMod Class Transformer — 唯一注册点
核心与设置
- FoamFix Mod —
@Mod入口,4 个生命周期钩子 - BugfixMod Settings —
ghostbuster8 /bugfixes13 /launchwrapper2 /tweaks5
补丁列表(按来源)
内存与运行时
- LaunchWrapper Runtime Fix — 反射弱化 2 个 LaunchWrapper 缓存
- JarDiscoverer Memory Leak Fix — 目标
cpw/mods/fml/common/discovery/JarDiscoverer
安全
- Log4JExploitFix — JndiLookup 指纹比对(738 / 983 字节),全局补丁
- BiblioRCEFix — 目标
jds/bibliocraft/FileUtil(第三方类) - HackyMessage Factory Wrapper — 反射改 log4j 私有字段
GhostBuster
- GhostBuster —
/ghostbuster命令 + 9 个补丁实例 - GhostBuster Logger
- GhostBuster Safe Accessors
客户端修复(会在专用服务器被强制关闭)
- BoatDesyncFix — 2 个实例
- HeartBlinkFix
- HeartFlashFix — 配套
HeartFlashFixCompatPatcher未注册 - ToolDesyncFix Event Handler — 事件式,有
isValid()门槛
手感 tweak(默认关闭)
- SnowballFix — 0 伤害雪球击退
- ItemBounceFix — 漏斗 + 楼梯,各默认
false - ChickenLureTweak — 母鸡吸引 AI,默认
false - VillageAnvilTweak — 铁匠铺铁砧,默认
false - ArrowDingTweak Event Handler — 怪物中箭音效,默认
false
渲染与平台
- EntityHeldItemNBT Render Fix
- TessellatorAlphaPassCrashFix
- SoundSystemUnpauseFix
- LinuxGuiChatBrowsePatch
补丁基础设施
- Modification Patcher — 逐条指令接口
- Global Modification Patcher — 整表接口
- ClassSplicingUtil — 注入体字节码拼接
Ears(1.8+ 皮肤)
代理
- Proxy —
ProxyClient/ProxyCommon
源码缺陷
BugfixModClassTransformer.java:219vs:507+AbstractPatcher.java:48—— 建表键为点号类名(replace('/', '.')),而transform()用 斜杠transformedName取表。静态阅读下按类定向的补丁恒不命中, 仅globalPatchers生效。待运行时核验(本 mod 长期使用,可能存在未包含的上游改动)。AbstractPatcher.java:111——successful ? "Applied transform!" : "Failed…"三元在此恒为 true 分支(已在if (!successful)的 else 里),日志文案是死代码。FoamFixMod.javapreinit —— 遗留两行System.out.println打印类路径; 对sun.boot.class.path的强转在部分启动器下会抛ClassCastException且未捕获。BugfixModClassTransformer.java:477-490——JndiLookup.class输入流仅在catch分支关闭,正常路径泄漏(每次启动一次,影响有限)。- 专用服务器降级会覆盖用户配置 ——
BoatDesyncFix/HeartBlink/HeartFlash被置false后立即config.save()落盘, 用户复制到客户端的配置文件会丢失原值。 Log4JLoggerWrapperPatcher是全局补丁 —— 目标类名为空串, 每个被加载的类都要跑一次patch(),启动期开销显著。AbstractPatcher.patch静默吞NullPointerException(注释指向 LiteLoader), 真实故障也会被误吞并静默返回原字节。