Skip to content

Commit

Permalink
Fix (Neo)Forge builtin coremods not being remapped
Browse files Browse the repository at this point in the history
Fixes #146.
  • Loading branch information
Juuxel committed Nov 2, 2023
1 parent 629e3c7 commit 8feac35
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,14 @@
import net.fabricmc.loom.util.function.FsPathConsumer;
import net.fabricmc.loom.util.service.ScopedSharedServiceManager;
import net.fabricmc.loom.util.service.SharedServiceManager;
import net.fabricmc.loom.util.srg.CoreModClassRemapper;
import net.fabricmc.loom.util.srg.InnerClassRemapper;
import net.fabricmc.mappingio.tree.MappingTree;
import net.fabricmc.mappingio.tree.MemoryMappingTree;

public class MinecraftPatchedProvider {
private static final String LOOM_PATCH_VERSION_KEY = "Loom-Patch-Version";
private static final String CURRENT_LOOM_PATCH_VERSION = "8";
private static final String CURRENT_LOOM_PATCH_VERSION = "9";
private static final String NAME_MAPPING_SERVICE_PATH = "/inject/META-INF/services/cpw.mods.modlauncher.api.INameMappingService";

private final Project project;
Expand Down Expand Up @@ -434,9 +436,17 @@ private void remapPatchedJar(SharedServiceManager serviceManager) throws Excepti
}

copyUserdevFiles(forgeUserdevJar, mcOutput);
remapCoreMods(mcOutput, serviceManager);
applyLoomPatchVersion(mcOutput);
}

private void remapCoreMods(Path patchedJar, SharedServiceManager serviceManager) throws Exception {
final MappingOption mappingOption = MappingOption.forPlatform(getExtension());
final TinyMappingsService mappingsService = getExtension().getMappingConfiguration().getMappingsService(serviceManager, mappingOption);
final MappingTree mappings = mappingsService.getMappingTree();
CoreModClassRemapper.remapJar(project, patchedJar, mappings);
}

private void patchJars() throws Exception {
Stopwatch stopwatch = Stopwatch.createStarted();
logger.lifecycle(":patching jars");
Expand Down

0 comments on commit 8feac35

Please sign in to comment.