diff options
author | snowleo <schneeleo@gmail.com> | 2011-07-16 01:33:22 +0200 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2011-07-16 01:33:22 +0200 |
commit | a38fe6acd4f5f6d7143c818653e9e02209f312db (patch) | |
tree | 7a993bdc1260364b8fad6a2d811fd608cb24c70c /EssentialsXMPP/src/com/earth2me | |
parent | 25c9557c594a065308dbd6dd4835f83c5028c54d (diff) | |
download | Essentials-a38fe6acd4f5f6d7143c818653e9e02209f312db.tar Essentials-a38fe6acd4f5f6d7143c818653e9e02209f312db.tar.gz Essentials-a38fe6acd4f5f6d7143c818653e9e02209f312db.tar.lz Essentials-a38fe6acd4f5f6d7143c818653e9e02209f312db.tar.xz Essentials-a38fe6acd4f5f6d7143c818653e9e02209f312db.zip |
Heavy cleanup of all classes
ItemDb is not static anymore
Essentials.getStatic() removed
Diffstat (limited to 'EssentialsXMPP/src/com/earth2me')
-rw-r--r-- | EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java index 04fe1be94..c0e56507c 100644 --- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java +++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java @@ -21,24 +21,25 @@ public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP private static EssentialsXMPP instance = null; private transient UserManager users; private transient XMPPManager xmpp; - + private transient IEssentials ess; + public static IEssentialsXMPP getInstance() { return instance; } - + @Override public void onEnable() { instance = this; - final IEssentials ess = Essentials.getStatic(); + final PluginManager pluginManager = getServer().getPluginManager(); + ess = (IEssentials)pluginManager.getPlugin("Essentials"); if (ess == null) { LOGGER.log(Level.SEVERE, "Failed to load Essentials before EssentialsXMPP"); } - - final PluginManager pluginManager = getServer().getPluginManager(); + final EssentialsXMPPPlayerListener playerListener = new EssentialsXMPPPlayerListener(ess); pluginManager.registerEvent(Type.PLAYER_JOIN, playerListener, Priority.Monitor, this); pluginManager.registerEvent(Type.PLAYER_CHAT, playerListener, Priority.Monitor, this); @@ -46,14 +47,15 @@ public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP users = new UserManager(this.getDataFolder()); xmpp = new XMPPManager(this); - + ess.addReloadListener(users); ess.addReloadListener(xmpp); - - if (!this.getDescription().getVersion().equals(Essentials.getStatic().getDescription().getVersion())) { + + if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) + { LOGGER.log(Level.WARNING, Util.i18n("versionMismatchAll")); } - LOGGER.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), Essentials.AUTHORS)); + LOGGER.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team")); } @Override @@ -65,9 +67,9 @@ public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP @Override public boolean onCommand(final CommandSender sender, final Command command, final String commandLabel, final String[] args) { - return Essentials.getStatic().onCommandEssentials(sender, command, commandLabel, args, EssentialsXMPP.class.getClassLoader(), "com.earth2me.essentials.xmpp.Command", "essentials."); + return ess.onCommandEssentials(sender, command, commandLabel, args, EssentialsXMPP.class.getClassLoader(), "com.earth2me.essentials.xmpp.Command", "essentials."); } - + @Override public void setAddress(final Player user, final String address) { @@ -80,7 +82,7 @@ public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP { return instance.users.getAddress(name); } - + @Override public String getUserByAddress(final String address) { |