summaryrefslogtreecommitdiffstats
path: root/EssentialsChat/src/com/earth2me/essentials
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
commit3888b08f6d406ae45e3b9fe308c48ba8631fea53 (patch)
treeb44e4573786d3ead3c9309224976ecbdd73c016c /EssentialsChat/src/com/earth2me/essentials
parentd127f535b2d21328e4ee107502fad31c4c34ca94 (diff)
downloadEssentials-3888b08f6d406ae45e3b9fe308c48ba8631fea53.tar
Essentials-3888b08f6d406ae45e3b9fe308c48ba8631fea53.tar.gz
Essentials-3888b08f6d406ae45e3b9fe308c48ba8631fea53.tar.lz
Essentials-3888b08f6d406ae45e3b9fe308c48ba8631fea53.tar.xz
Essentials-3888b08f6d406ae45e3b9fe308c48ba8631fea53.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 'EssentialsChat/src/com/earth2me/essentials')
-rw-r--r--EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java19
1 files changed, 14 insertions, 5 deletions
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java
index f547f0da0..6600ff91d 100644
--- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java
+++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java
@@ -21,6 +21,15 @@ public class EssentialsChat extends JavaPlugin
{
final PluginManager pluginManager = getServer().getPluginManager();
final IEssentials ess = (IEssentials)pluginManager.getPlugin("Essentials");
+ if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion()))
+ {
+ LOGGER.log(Level.WARNING, _("versionMismatchAll"));
+ }
+ if (!ess.isEnabled())
+ {
+ this.setEnabled(false);
+ return;
+ }
chatListener = new HashMap<String, IEssentialsChatListener>();
@@ -30,16 +39,16 @@ public class EssentialsChat extends JavaPlugin
pluginManager.registerEvent(Type.PLAYER_CHAT, playerListenerLowest, Priority.Lowest, this);
pluginManager.registerEvent(Type.PLAYER_CHAT, playerListenerNormal, Priority.Normal, this);
pluginManager.registerEvent(Type.PLAYER_CHAT, playerListenerHighest, Priority.Highest, this);
- if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion()))
- {
- LOGGER.log(Level.WARNING, _("versionMismatchAll"));
- }
+
LOGGER.info(_("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
}
public void onDisable()
{
- chatListener.clear();
+ if (chatListener != null)
+ {
+ chatListener.clear();
+ }
}
public void addEssentialsChatListener(final String plugin, final IEssentialsChatListener listener)