Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit 5d385b0

Browse files
committed
Add a truncated version of ModList
Reasoning: mods often check if a certain mod is loaded, but most other behavior provided by this class for mods to use is either for things like getting ASM scanned annotations or otherwise out of the scope of Patchwork for the time being.
1 parent 2da678c commit 5d385b0

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

  • patchwork-fml/src/main/java/net/minecraftforge/fml
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package net.minecraftforge.fml;
2+
3+
import java.util.List;
4+
5+
public class ModList {
6+
private static ModList INSTANCE;
7+
private List<String> mods;
8+
//Patchwork: signature changed to just have a list of modids
9+
private ModList(List<String> mods) {
10+
this.mods = mods;
11+
}
12+
public static ModList get() {
13+
return INSTANCE;
14+
}
15+
//Patchwork: method does not exist in Forge
16+
public static ModList create(List<String> mods) {
17+
INSTANCE = new ModList(mods);
18+
return INSTANCE;
19+
}
20+
21+
public boolean isLoaded(String modId) {
22+
return this.mods.contains(modId);
23+
}
24+
25+
}

0 commit comments

Comments
 (0)