fix bug in iConomy versioning that shows up before the plugin is loaded.

This commit is contained in:
Sleaker 2012-12-12 11:50:20 -08:00
parent 95fc0362dd
commit 03392869eb
1 changed files with 4 additions and 2 deletions

View File

@ -52,9 +52,9 @@ public class Economy_iConomy6 implements Economy {
// Load Plugin in case it was loaded before
if (economy == null) {
Plugin ec = plugin.getServer().getPluginManager().getPlugin("iConomy");
String version = ec.getDescription().getVersion().split(".")[0];
name += version;
if (ec != null && ec.isEnabled() && ec.getClass().getName().equals("com.iCo6.iConomy")) {
String version = ec.getDescription().getVersion().split(".")[0];
name += version;
economy = (iConomy) ec;
accounts = new Accounts();
log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), name));
@ -75,6 +75,8 @@ public class Economy_iConomy6 implements Economy {
Plugin ec = plugin.getServer().getPluginManager().getPlugin("iConomy");
if (ec != null && ec.isEnabled() && ec.getClass().getName().equals("com.iCo6.iConomy")) {
String version = ec.getDescription().getVersion().split(".")[0];
name += version;
economy.economy = (iConomy) ec;
accounts = new Accounts();
log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), economy.name));