added perworlditems check

This commit is contained in:
Gabriele C 2015-08-01 01:05:05 +02:00
parent 945b24990a
commit 72f0f65bed
2 changed files with 30 additions and 6 deletions

View File

@ -187,14 +187,17 @@ public class AuthMe extends JavaPlugin {
mail = new SendMailSSL(this);
// Check Citizens Version
citizensVersion();
checkCitizens();
// Check Combat Tag Version
combatTag();
checkCombatTag();
// Check Multiverse
checkMultiverse();
// Check PerWorldInventories Version
checkPerWorldInventories();
// Check ChestShop
checkChestShop();
@ -354,6 +357,27 @@ public class AuthMe extends JavaPlugin {
}
}
public void checkPerWorldInventories() {
if (this.getServer().getPluginManager().getPlugin("PerWorldInventories") != null && this.getServer().getPluginManager().getPlugin("PerWorldInventories").isEnabled()) {
try {
String ver = Bukkit.getServer().getPluginManager().getPlugin("PerWorldInventories").getDescription().getVersion();
try {
double version = Double.valueOf(ver.split(" ")[0]);
if (version < 1.57)
ConsoleLogger.showError("Please Update your PerWorldInventories version! INVENTORY WIPE may occur!");
} catch (NumberFormatException nfe) {
try {
double version = Double.valueOf(ver.split("t")[0]);
if (version < 1.57)
ConsoleLogger.showError("Please Update your PerWorldInventories version! INVENTORY WIPE may occur!");
} catch (NumberFormatException nfee) {
}
}
} catch (Exception e) {
}
}
}
public void checkMultiverse() {
if (!Settings.multiverse) {
multiverse = null;
@ -403,7 +427,7 @@ public class AuthMe extends JavaPlugin {
}
}
public void combatTag() {
public void checkCombatTag() {
if (this.getServer().getPluginManager().getPlugin("CombatTag") != null && this.getServer().getPluginManager().getPlugin("CombatTag").isEnabled()) {
this.CombatTag = true;
} else {
@ -411,7 +435,7 @@ public class AuthMe extends JavaPlugin {
}
}
public void citizensVersion() {
public void checkCitizens() {
if (this.getServer().getPluginManager().getPlugin("Citizens") != null && this.getServer().getPluginManager().getPlugin("Citizens").isEnabled())
this.isCitizensActive = true;
else this.isCitizensActive = false;

View File

@ -84,9 +84,9 @@ public class AuthMeServerListener implements Listener {
if (pluginName.equalsIgnoreCase("ChestShop"))
plugin.checkChestShop();
if (pluginName.equalsIgnoreCase("CombatTag"))
plugin.combatTag();
plugin.checkCombatTag();
if (pluginName.equalsIgnoreCase("Citizens"))
plugin.citizensVersion();
plugin.checkCitizens();
if (pluginName.equalsIgnoreCase("Vault"))
plugin.checkVault();
}