diff options
author | KHobbits <rob@khobbits.co.uk> | 2011-12-01 13:47:06 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2011-12-01 13:47:06 +0000 |
commit | f0069326393cc145c0fd21e002a8eaac1a9681d8 (patch) | |
tree | 5a22fd2e93ef9a85643e1da860a91dab493e2468 /EssentialsXMPP/src/com/earth2me/essentials | |
parent | 2dc6f8c20236dfa76b09bd4bd9e522cd0d1c354b (diff) | |
parent | 39851694ad9e55e425ff7cb03c05cdb70a16f5a4 (diff) | |
download | Essentials-f0069326393cc145c0fd21e002a8eaac1a9681d8.tar Essentials-f0069326393cc145c0fd21e002a8eaac1a9681d8.tar.gz Essentials-f0069326393cc145c0fd21e002a8eaac1a9681d8.tar.lz Essentials-f0069326393cc145c0fd21e002a8eaac1a9681d8.tar.xz Essentials-f0069326393cc145c0fd21e002a8eaac1a9681d8.zip |
Merge branch 'master' of github.com:essentials/Essentials
Conflicts:
Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
Essentials/src/com/earth2me/essentials/commands/Commandenchant.java
Diffstat (limited to 'EssentialsXMPP/src/com/earth2me/essentials')
-rw-r--r-- | EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java index 06575851d..56126e23b 100644 --- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java +++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java @@ -36,9 +36,14 @@ public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP final PluginManager pluginManager = getServer().getPluginManager(); ess = (IEssentials)pluginManager.getPlugin("Essentials"); - if (ess == null) + if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) { - LOGGER.log(Level.SEVERE, "Failed to load Essentials before EssentialsXMPP"); + LOGGER.log(Level.WARNING, _("versionMismatchAll")); + } + if (!ess.isEnabled()) + { + this.setEnabled(false); + return; } final EssentialsXMPPPlayerListener playerListener = new EssentialsXMPPPlayerListener(ess); @@ -52,17 +57,16 @@ public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP ess.addReloadListener(users); ess.addReloadListener(xmpp); - if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) - { - LOGGER.log(Level.WARNING, _("versionMismatchAll")); - } LOGGER.info(_("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team")); } @Override public void onDisable() { - xmpp.disconnect(); + if (xmpp != null) + { + xmpp.disconnect(); + } } @Override |