Adds ability to turn off dependency checks in conf.json

This commit is contained in:
DroppingAnvil 2019-10-17 13:00:00 -05:00
parent 93744347db
commit 77c74e10ac
2 changed files with 14 additions and 14 deletions

View File

@ -226,7 +226,8 @@ public class Conf {
/// Useful for HCF features. /// Useful for HCF features.
/// </summary> /// </summary>
public static Set<Material> territoryBypassProtectedMaterials = EnumSet.noneOf(Material.class); public static Set<Material> territoryBypassProtectedMaterials = EnumSet.noneOf(Material.class);
// Dependency check
public static boolean dependencyCheck = true;
// Economy settings // Economy settings
public static boolean econEnabled = false; public static boolean econEnabled = false;
public static String econUniverseAccount = ""; public static String econUniverseAccount = "";

View File

@ -168,18 +168,6 @@ public class FactionsPlugin extends MPlugin {
mc114 = true; mc114 = true;
break; break;
} }
//Dependency checks
if (Bukkit.getPluginManager().isPluginEnabled("Vault") && Bukkit.getPluginManager().isPluginEnabled("Essentials")) {
RegisteredServiceProvider<Economy> rsp = FactionsPlugin.this.getServer().getServicesManager().getRegistration(Economy.class);
FactionsPlugin.econ = rsp.getProvider();
} else {
divider();
System.out.println("You are missing dependencies!");
System.out.println("Please verify EssentialsX and Vault are installed!");
Bukkit.getPluginManager().disablePlugin(instance);
divider();
return;
}
migrateFPlayerLeaders(); migrateFPlayerLeaders();
log("==== End Setup ===="); log("==== End Setup ====");
@ -194,7 +182,18 @@ public class FactionsPlugin extends MPlugin {
} }
//Attempt to generate a permission list //Attempt to generate a permission list
PermissionList.generateFile(); PermissionList.generateFile();
//Dependency checks
if (Conf.dependencyCheck && (Bukkit.getPluginManager().isPluginEnabled("Vault") && Bukkit.getPluginManager().isPluginEnabled("Essentials"))) {
RegisteredServiceProvider<Economy> rsp = FactionsPlugin.this.getServer().getServicesManager().getRegistration(Economy.class);
FactionsPlugin.econ = rsp.getProvider();
} else if (Conf.dependencyCheck) {
divider();
System.out.println("You are missing dependencies!");
System.out.println("Please verify EssentialsX and Vault are installed!");
Bukkit.getPluginManager().disablePlugin(instance);
divider();
return;
}
// Load Conf from disk // Load Conf from disk
Conf.load(); Conf.load();
com.massivecraft.factions.integration.Essentials.setup(); com.massivecraft.factions.integration.Essentials.setup();