Skip to content

Refmap remapping on modlauncher in dev #462

Description

@Niko-sk2x

Legacy FML agent has this code

private void injectRemapper() {
try {
MixinPlatformAgentAbstract.logger.debug("Creating FML remapper adapter: {}", MixinPlatformAgentFMLLegacy.FML_REMAPPER_ADAPTER_CLASS);
Class<?> clFmlRemapperAdapter = Class.forName(MixinPlatformAgentFMLLegacy.FML_REMAPPER_ADAPTER_CLASS, true, Launch.classLoader);
Method mdCreate = clFmlRemapperAdapter.getDeclaredMethod("create");
IRemapper remapper = (IRemapper)mdCreate.invoke(null);
MixinEnvironment.getDefaultEnvironment().getRemappers().add(remapper);
} catch (Exception ex) {
MixinPlatformAgentAbstract.logger.debug("Failed instancing FML remapper adapter, things will probably go horribly for notch-obf'd mods!");
}
}

and this allows remapping refmap to work. Modlauncher specific agent doesn't have an equivalent.

While this wouldn't allow mods using mixin to work in dev just by putting them into mods folder (because that's not supported at all), this should allow dependencies added with fg.deobf to work (since the dependency remaping uses this code https://github.com/MinecraftForge/InstallerTools/blob/9147fcae6e088daf02d31a01ce6724ce91361ffa/src/main/java/net/minecraftforge/installertools/SrgMcpRenamer.java#L99-L112 which would remap shadows and overwrites correctly).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions