From e94a01b149464032ce9049b7800bb793d3bd25d8 Mon Sep 17 00:00:00 2001 From: ementalo Date: Fri, 3 Jun 2011 14:23:55 +0000 Subject: [trunk] Adding dependancy checker, need to fix timings as Protect tries to use it before the file system finishes git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1579 e251c2fe-e539-e718-e476-b85c1f46cddb --- .../com/earth2me/essentials/protect/EssentialsProtect.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'EssentialsProtect/src/com/earth2me/essentials/protect') diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java index bdcb167b8..7a7772ea6 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java @@ -50,14 +50,10 @@ public class EssentialsProtect extends JavaPlugin implements IConf public void onEnable() { - ess = Essentials.getStatic(); - PluginManager pm = this.getServer().getPluginManager(); - Essentials ess = (Essentials)pm.getPlugin("Essentials"); - if (!ess.isEnabled()) - { - pm.enablePlugin(ess); - } + PluginManager pm = this.getServer().getPluginManager(); + ess = Essentials.getStatic(); + ess.getDependancyChecker().checkProtectDependancies(); instance = this; reloadConfig(); @@ -77,7 +73,7 @@ public class EssentialsProtect extends JavaPlugin implements IConf pm.registerEvent(Type.LIGHTNING_STRIKE, weatherListener, Priority.Highest, this); pm.registerEvent(Type.THUNDER_CHANGE, weatherListener, Priority.Highest, this); pm.registerEvent(Type.WEATHER_CHANGE, weatherListener, Priority.Highest, this); - + if (!this.getDescription().getVersion().equals(Essentials.getStatic().getDescription().getVersion())) { logger.log(Level.WARNING, "Version mismatch! Please update all Essentials jars to the same version."); -- cgit v1.2.3