Config for ICompatibility
This commit is contained in:
parent
349efbd510
commit
72d4c5e135
|
@ -40,7 +40,7 @@ repositories {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
deobfCompile "mezz.jei:jei_1.8.8:2.1.0.8"
|
deobfCompile "mezz.jei:jei_1.8.8:2.1.2.10"
|
||||||
}
|
}
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
|
|
|
@ -87,6 +87,9 @@ public class ConfigHandler {
|
||||||
public static boolean vanillaPotionHealthBoostEnabled;
|
public static boolean vanillaPotionHealthBoostEnabled;
|
||||||
public static boolean vanillaPotionAbsorptionEnabled;
|
public static boolean vanillaPotionAbsorptionEnabled;
|
||||||
|
|
||||||
|
// Compat
|
||||||
|
public static boolean compatibilityJustEnoughItems;
|
||||||
|
|
||||||
public static void init(File file) {
|
public static void init(File file) {
|
||||||
config = new Configuration(file);
|
config = new Configuration(file);
|
||||||
syncConfig();
|
syncConfig();
|
||||||
|
@ -171,6 +174,10 @@ public class ConfigHandler {
|
||||||
config.addCustomCategoryComment(category, "General settings");
|
config.addCustomCategoryComment(category, "General settings");
|
||||||
BloodMagicAPI.setLoggingEnabled(config.getBoolean("enableLogging", category, true, "Allows logging information to the console. Fatal errors will bypass this"));
|
BloodMagicAPI.setLoggingEnabled(config.getBoolean("enableLogging", category, true, "Allows logging information to the console. Fatal errors will bypass this"));
|
||||||
|
|
||||||
|
category = "Compatibility";
|
||||||
|
config.addCustomCategoryComment(category, "Compatibility settings");
|
||||||
|
compatibilityJustEnoughItems = config.getBoolean("compatibilityJustEnoughItems", category, true, "Enables the JEI recipe categories for specialized recipes.");
|
||||||
|
|
||||||
config.save();
|
config.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,4 +14,11 @@ public interface ICompatibility {
|
||||||
* The {@code modid} of the mod we are adding compatibility for.
|
* The {@code modid} of the mod we are adding compatibility for.
|
||||||
*/
|
*/
|
||||||
String getModId();
|
String getModId();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether or not compatibility should be loaded even if the mod were to be found.
|
||||||
|
*
|
||||||
|
* Generally a determined by a config option.
|
||||||
|
*/
|
||||||
|
boolean enableCompat();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package WayofTime.bloodmagic.compat.jei;
|
package WayofTime.bloodmagic.compat.jei;
|
||||||
|
|
||||||
|
import WayofTime.bloodmagic.ConfigHandler;
|
||||||
import WayofTime.bloodmagic.compat.ICompatibility;
|
import WayofTime.bloodmagic.compat.ICompatibility;
|
||||||
import mezz.jei.api.JEIManager;
|
import mezz.jei.api.JEIManager;
|
||||||
|
|
||||||
|
@ -14,4 +15,9 @@ public class CompatibilityJustEnoughItems implements ICompatibility {
|
||||||
public String getModId() {
|
public String getModId() {
|
||||||
return "JEI";
|
return "JEI";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean enableCompat() {
|
||||||
|
return ConfigHandler.compatibilityJustEnoughItems;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ public class ModCompatibility {
|
||||||
compatibilities.add(new CompatibilityJustEnoughItems());
|
compatibilities.add(new CompatibilityJustEnoughItems());
|
||||||
|
|
||||||
for (ICompatibility compat : compatibilities) {
|
for (ICompatibility compat : compatibilities) {
|
||||||
if (Loader.isModLoaded(compat.getModId()))
|
if (compat.enableCompat() && Loader.isModLoaded(compat.getModId()))
|
||||||
compat.loadCompatibility();
|
compat.loadCompatibility();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue