forked from runescapejon/AdventureBackpack2
-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathLoadedMods.java
More file actions
43 lines (33 loc) · 1.61 KB
/
LoadedMods.java
File metadata and controls
43 lines (33 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package com.darkona.adventurebackpack.reference;
import net.minecraft.launchwrapper.Launch;
import com.darkona.adventurebackpack.util.LogHelper;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ModContainer;
public final class LoadedMods {
public static final boolean DEV_ENV = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
public static final boolean BUILDCRAFT = registerMod("BuildCraft|Core");
public static final boolean ENDERIO = registerMod("EnderIO");
public static final boolean GREGTECH = registerMod("gregtech");
public static final boolean NEI = registerMod("NotEnoughItems");
public static final boolean TCONSTRUCT = registerMod("TConstruct");
public static final boolean THAUMCRAFT = registerMod("Thaumcraft");
public static final boolean WAILA = registerMod("waila");
public static final boolean HUNGEROVERHAUL = registerMod("HungerOverhaul");
public static final boolean WITCHERY = registerMod("witchery");
public static final boolean WITCHINGGADGETS = registerMod("WitchingGadgets");
private LoadedMods() {}
public static void init() {
if (DEV_ENV) {
LogHelper.info("Dev environment detected. All hail the creator");
}
}
private static boolean registerMod(String modID) {
if (!Loader.isModLoaded(modID)) return false;
String modName = modID;
for (ModContainer mod : Loader.instance().getModList()) {
if (mod.getModId().equals(modID)) modName = mod.getName();
}
LogHelper.info(modName + " is present. Acting accordingly");
return true;
}
}