Package net.fabricmc.loom.core
Class ModJarRemap
java.lang.Object
net.fabricmc.loom.core.ModJarRemap
L4 计算核心:构建用于 mod jar 重映射的
TinyRemapper.
为什么需要这个类
本仓库里同时存在**三条** remapper 构造路径,各自的配置并不相同:| 用途 | 构造点 | 特征 |
|---|---|---|
| Minecraft jar | TinyRemapperHelper.getTinyRemapper(org.gradle.api.Project, net.fabricmc.loom.util.service.ServiceFactory, java.lang.String, java.lang.String) |
renameInvalidLocals(true) + invalidLvNamePattern +
inferNameFromSameLvIndex(true) + ignoreConflicts +
rebuildSourceFilenames;针对混淆 jar 的 LVT 特性 |
| mod jar | 本类 | renameInvalidLocals(false);不启用上述 LVT 处理 |
| 任务型重映射 | TinyRemapperService |
不设置上述任何一项,走 MappingsService 的映射提供者 |
三者**有意不同**,不能统一——把 MC jar 的 LVT 设置套到 mod jar 上会改变产物。
但也正因为如此,「任务化」时极易拿错配置:RemapMinecraftTask 的等价性
验证就是这样抓到过一次回归(任务用了 service 的构造,产出与配置期逐字节不同)。
本类的职责是把 mod jar 这条路径的构造**固定在一个地方**,
让 ModProcessor 与将来的任务实现共用它,从而不可能各自漂移。
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic net.fabricmc.tinyremapper.TinyRemapper.BuildercreateRemapper(net.fabricmc.mappingio.tree.MemoryMappingTree mappings, Set<String> knownIndyBsms, String productionNamespace, String targetNamespace, @Nullable net.fabricmc.tinyremapper.TinyRemapper.AnalyzeVisitorProvider analyzeVisitor, ModJarRemap.Extensions extensions)
-
Method Details
-
createRemapper
public static net.fabricmc.tinyremapper.TinyRemapper.Builder createRemapper(net.fabricmc.mappingio.tree.MemoryMappingTree mappings, Set<String> knownIndyBsms, String productionNamespace, String targetNamespace, @Nullable net.fabricmc.tinyremapper.TinyRemapper.AnalyzeVisitorProvider analyzeVisitor, ModJarRemap.Extensions extensions) throws IOException - Throws:
IOException
-