Merge pull request #160 from AuthMe-Team/master

PerWorldItems version check + little fix
This commit is contained in:
Alexandre Vanhecke 2015-08-01 01:52:17 +02:00
commit 9823956658
3 changed files with 32 additions and 6 deletions

View File

@ -187,14 +187,17 @@ public class AuthMe extends JavaPlugin {
mail = new SendMailSSL(this); mail = new SendMailSSL(this);
// Check Citizens Version // Check Citizens Version
citizensVersion(); checkCitizens();
// Check Combat Tag Version // Check Combat Tag Version
combatTag(); checkCombatTag();
// Check Multiverse // Check Multiverse
checkMultiverse(); checkMultiverse();
// Check PerWorldInventories Version
checkPerWorldInventories();
// Check ChestShop // Check ChestShop
checkChestShop(); 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() { public void checkMultiverse() {
if (!Settings.multiverse) { if (!Settings.multiverse) {
multiverse = null; 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()) { if (this.getServer().getPluginManager().getPlugin("CombatTag") != null && this.getServer().getPluginManager().getPlugin("CombatTag").isEnabled()) {
this.CombatTag = true; this.CombatTag = true;
} else { } 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()) if (this.getServer().getPluginManager().getPlugin("Citizens") != null && this.getServer().getPluginManager().getPlugin("Citizens").isEnabled())
this.isCitizensActive = true; this.isCitizensActive = true;
else this.isCitizensActive = false; else this.isCitizensActive = false;

View File

@ -306,6 +306,8 @@ public class FileCache {
a++; a++;
} }
} }
if (reader != null)
reader.close();
return new DataFileCache(stacki, stacka, group, op, flying); return new DataFileCache(stacki, stacka, group, op, flying);
} else { } else {
// NEW METHOD // NEW METHOD

View File

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