Skip to content

Commit

Permalink
AccessWidenerUtils: Ignore fabric.mod.json on (Neo)Forge
Browse files Browse the repository at this point in the history
Fixes #165. Closes #180.
  • Loading branch information
Juuxel committed Dec 9, 2023
1 parent 827c0e9 commit 9f070d2
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import net.fabricmc.loom.util.ModPlatform;
import net.fabricmc.loom.util.fmj.FabricModJson;
import net.fabricmc.loom.util.fmj.FabricModJsonFactory;
import net.fabricmc.loom.util.fmj.ModMetadataFabricModJson;

public class AccessWidenerUtils {
/**
Expand All @@ -63,6 +64,13 @@ public static AccessWidenerData readAccessWidenerData(Path inputJar, ModPlatform
}

final FabricModJson fabricModJson = FabricModJsonFactory.createFromZip(inputJar);

if (platform.isForgeLike() && !(fabricModJson instanceof ModMetadataFabricModJson)) {
// Ignore actual fabric.mod.json files on NeoForge and Forge.
// See https://github.com/architectury/architectury-loom/issues/165.
return null;
}

final List<String> classTweakers = List.copyOf(fabricModJson.getClassTweakers().keySet());

if (classTweakers.isEmpty()) {
Expand Down

0 comments on commit 9f070d2

Please sign in to comment.