diff options
Diffstat (limited to 'EssentialsChat/src/net/ess3')
3 files changed, 9 insertions, 6 deletions
diff --git a/EssentialsChat/src/net/ess3/chat/EssentialsChat.java b/EssentialsChat/src/net/ess3/chat/EssentialsChat.java index 4c922c45f..66286a3af 100644 --- a/EssentialsChat/src/net/ess3/chat/EssentialsChat.java +++ b/EssentialsChat/src/net/ess3/chat/EssentialsChat.java @@ -9,6 +9,7 @@ import java.util.HashMap; import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; +import net.ess3.api.IPlugin; import org.bukkit.event.player.PlayerChatEvent; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; @@ -22,12 +23,13 @@ public class EssentialsChat extends JavaPlugin public void onEnable() { final PluginManager pluginManager = getServer().getPluginManager(); - final IEssentials ess = (IEssentials)pluginManager.getPlugin("Essentials-3"); - if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) + final IPlugin plugin = (IPlugin)pluginManager.getPlugin("Essentials-3"); + final IEssentials ess = (IEssentials)plugin.getEssentials(); + if (!this.getDescription().getVersion().equals(plugin.getDescription().getVersion())) { LOGGER.log(Level.WARNING, _("versionMismatchAll")); } - if (!ess.isEnabled()) + if (!plugin.isEnabled()) { this.setEnabled(false); return; diff --git a/EssentialsChat/src/net/ess3/chat/EssentialsChatPlayer.java b/EssentialsChat/src/net/ess3/chat/EssentialsChatPlayer.java index f3ce3abaf..9bf791372 100644 --- a/EssentialsChat/src/net/ess3/chat/EssentialsChatPlayer.java +++ b/EssentialsChat/src/net/ess3/chat/EssentialsChatPlayer.java @@ -12,6 +12,7 @@ import net.ess3.utils.Util; import java.util.Locale; import java.util.Map; import java.util.logging.Logger; +import net.ess3.utils.FormatUtil; import org.bukkit.Server; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -80,10 +81,10 @@ public abstract class EssentialsChatPlayer implements Listener final IUser user = chatStore.getUser(); if (Permissions.CHAT_COLOR.isAuthorized(user)) { - event.setMessage(Util.stripColor(event.getMessage())); + event.setMessage(FormatUtil.stripColor(event.getMessage())); } String group = ess.getRanks().getMainGroup(user); - String world = user.getWorld().getName(); + String world = user.getPlayer().getWorld().getName(); IRanks groupSettings = ess.getRanks(); event.setFormat(groupSettings.getChatFormat(user).format(new Object[] diff --git a/EssentialsChat/src/net/ess3/chat/EssentialsLocalChatEventListener.java b/EssentialsChat/src/net/ess3/chat/EssentialsLocalChatEventListener.java index f248a21a4..be4c5305c 100644 --- a/EssentialsChat/src/net/ess3/chat/EssentialsLocalChatEventListener.java +++ b/EssentialsChat/src/net/ess3/chat/EssentialsLocalChatEventListener.java @@ -43,7 +43,7 @@ public class EssentialsLocalChatEventListener implements Listener if (!user.equals(sender)) { boolean abort = false; - final Location playerLoc = user.getLocation(); + final Location playerLoc = user.getPlayer().getLocation(); if (playerLoc.getWorld() != world) { abort = true; |