Merge from DroppingAnvil/1.6.x

Added ability to disable dependency checks
This commit is contained in:
DroppingAnvil 2019-10-17 13:02:55 -05:00 committed by GitHub
commit a97e0f2b31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 14 deletions

View File

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

View File

@ -168,18 +168,6 @@ public class FactionsPlugin extends MPlugin {
mc114 = true;
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();
log("==== End Setup ====");
@ -194,9 +182,20 @@ public class FactionsPlugin extends MPlugin {
}
//Attempt to generate a permission list
PermissionList.generateFile();
// Load Conf from disk
Conf.load();
//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;
}
com.massivecraft.factions.integration.Essentials.setup();
hookedPlayervaults = setupPlayervaults();
FPlayers.getInstance().load();