summaryrefslogtreecommitdiffstats
path: root/EssentialsChat
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-07-16 01:33:22 +0200
committersnowleo <schneeleo@gmail.com>2011-07-16 01:33:22 +0200
commita38fe6acd4f5f6d7143c818653e9e02209f312db (patch)
tree7a993bdc1260364b8fad6a2d811fd608cb24c70c /EssentialsChat
parent25c9557c594a065308dbd6dd4835f83c5028c54d (diff)
downloadEssentials-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 'EssentialsChat')
-rw-r--r--EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java10
-rw-r--r--EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListener.java13
2 files changed, 8 insertions, 15 deletions
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java
index 5fb8e9842..fcc734de2 100644
--- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java
+++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java
@@ -1,6 +1,6 @@
package com.earth2me.essentials.chat;
-import com.earth2me.essentials.Essentials;
+import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.Util;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -17,17 +17,17 @@ public class EssentialsChat extends JavaPlugin
public void onEnable()
{
final PluginManager pluginManager = getServer().getPluginManager();
+ final IEssentials ess = (IEssentials)pluginManager.getPlugin("Essentials");
EssentialsChatPlayerListener.checkFactions(pluginManager);
- final EssentialsChatPlayerListener playerListener = new EssentialsChatPlayerListener(getServer());
- pluginManager.registerEvent(Type.PLAYER_JOIN, playerListener, Priority.Lowest, this);
+ final EssentialsChatPlayerListener playerListener = new EssentialsChatPlayerListener(getServer(), ess);
pluginManager.registerEvent(Type.PLAYER_CHAT, playerListener, Priority.Highest, this);
- 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"));
}
public void onDisable()
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListener.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListener.java
index 466641e32..60af127ad 100644
--- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListener.java
+++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListener.java
@@ -1,6 +1,5 @@
package com.earth2me.essentials.chat;
-import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
@@ -12,7 +11,6 @@ import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerChatEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerListener;
-import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
@@ -22,19 +20,14 @@ import org.mcteam.factions.Factions;
public class EssentialsChatPlayerListener extends PlayerListener
{
private static final Logger LOGGER = Logger.getLogger("Minecraft");
- private final transient IEssentials ess = Essentials.getStatic();
+ private final transient IEssentials ess;
private final transient Server server;
private static Factions factions = null;
- public EssentialsChatPlayerListener(final Server server)
+ public EssentialsChatPlayerListener(final Server server, final IEssentials ess)
{
this.server = server;
- }
-
- @Override
- public void onPlayerJoin(final PlayerJoinEvent event)
- {
- final User user = ess.getUser(event.getPlayer());
+ this.ess = ess;
}
@Override