diff options
Diffstat (limited to 'EssentialsChat')
-rw-r--r-- | EssentialsChat/nbproject/project.properties | 3 | ||||
-rw-r--r-- | EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java | 19 |
2 files changed, 15 insertions, 7 deletions
diff --git a/EssentialsChat/nbproject/project.properties b/EssentialsChat/nbproject/project.properties index 0ce40b48b..e59815e40 100644 --- a/EssentialsChat/nbproject/project.properties +++ b/EssentialsChat/nbproject/project.properties @@ -79,8 +79,7 @@ javac.target=1.6 javac.test.classpath=\ ${javac.classpath}:\ ${build.classes.dir}:\ - ${libs.junit.classpath}:\ - ${libs.junit_4.classpath} + ${libs.junit_4.10.classpath} javac.test.processorpath=\ ${javac.test.classpath} javadoc.additionalparam= 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) |