summaryrefslogtreecommitdiffstats
path: root/EssentialsXMPP
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-11-30 20:48:42 +0100
committersnowleo <schneeleo@gmail.com>2011-11-30 20:49:11 +0100
commit5e2123c91e44b9ea0a2aa61ca8d889e506274875 (patch)
tree719c498eba31f10d497e4b21645ebe0b3d045fd9 /EssentialsXMPP
parent15d8ec6026a65db176e698db0ec0151f0a1215a4 (diff)
downloadEssentials-5e2123c91e44b9ea0a2aa61ca8d889e506274875.tar
Essentials-5e2123c91e44b9ea0a2aa61ca8d889e506274875.tar.gz
Essentials-5e2123c91e44b9ea0a2aa61ca8d889e506274875.tar.lz
Essentials-5e2123c91e44b9ea0a2aa61ca8d889e506274875.tar.xz
Essentials-5e2123c91e44b9ea0a2aa61ca8d889e506274875.zip
If Essentials core fails to read one of the configs now, it will disable itself. If other modules detect that Essentials is not enabled, they will be disabled too. EssentialsProtect will go into emergency mode, canceling all events that could hurt your world. Fix the file and either restart or reload the server.
Diffstat (limited to 'EssentialsXMPP')
-rw-r--r--EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java18
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