File tree Expand file tree Collapse file tree
src/main/java/com/terraformersmc/modmenu/util/mod/fabric Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,6 +93,13 @@ public FabricMod(ModContainer modContainer, Set<String> modpackMods) {
9393 allowsUpdateChecks = CustomValueUtil .getBoolean ("update_checker" , modMenuObject ).orElse (true );
9494 }
9595
96+ boolean isGenerated = CustomValueUtil .getBoolean ("fabric-loom:generated" , metadata ).orElse (false );
97+
98+ /* Automatically set the mod containing a Loom-generated library as its parent */
99+ if (isGenerated && parentId .isEmpty () && container .getContainingMod ().isPresent ()) {
100+ ModContainer inside = container .getContainingMod ().get ();
101+ parentId = Optional .of (inside .getMetadata ().getId ());
102+ }
96103 this .modMenuData = new ModMenuData (badgeNames , parentId , parentData , id );
97104
98105 /* Hardcode parents and badges for Fabric API & Fabric Loader */
@@ -119,10 +126,7 @@ public FabricMod(ModContainer modContainer, Set<String> modpackMods) {
119126 badges .add (Badge .CLIENT );
120127 }
121128
122- if (OptionalUtil .isPresentAndTrue (CustomValueUtil .getBoolean (
123- "fabric-loom:generated" ,
124- metadata
125- )) || "java" .equals (id )) {
129+ if (isGenerated || "java" .equals (id )) {
126130 badges .add (Badge .LIBRARY );
127131 }
128132
You can’t perform that action at this time.
0 commit comments