diff --git a/vMinecraftChat.java b/vMinecraftChat.java index 53bd6affc..3f55bb844 100644 --- a/vMinecraftChat.java +++ b/vMinecraftChat.java @@ -247,7 +247,11 @@ public class vMinecraftChat { String adminchat = Colors.DarkPurple + "{" + getName(player) + Colors.DarkPurple +"}" + Colors.White + " "; - String[] msg = wordWrap(adminchat + message.substring(1, message.length())); + //Cut off the @ prefix + if(message.startsWith("@")) + message = message.substring(1, message.length()); + + String[] msg = wordWrap(adminchat + message); //Get the player from the playerlist to send the message to. for (Player p: etc.getServer().getPlayerList()) { @@ -272,26 +276,6 @@ public class vMinecraftChat { } return false; } - - public static boolean adminChatToggle(Player player, String message){ - if(vMinecraftSettings.getInstance().isAdminToggled(player.getName())) { - String adminchat = Colors.DarkPurple + "{" + getName(player) - + Colors.DarkPurple +"}" + Colors.White + " "; - String[] msg = wordWrap(adminchat + message.substring(1, message.length())); - for (Player p: etc.getServer().getPlayerList()) { - if (p != null) { - if (p.isAdmin() || p.canUseCommand("/adminchat")) { - for(String str: msg) - p.sendMessage(str); - } - } - } - log.log(Level.INFO, "@" + "<" + getName(player) - + Colors.White +"> " + message); - return true; - } - return false; - } //===================================================================== //Function: quote diff --git a/vMinecraftListener.java b/vMinecraftListener.java index 3d1aa54d1..6c4add0ec 100644 --- a/vMinecraftListener.java +++ b/vMinecraftListener.java @@ -29,10 +29,9 @@ public class vMinecraftListener extends PluginListener { public boolean onChat(Player player, String message){ //Quote (Greentext) - if (message.startsWith("@")) + if (message.startsWith("@") || + vMinecraftSettings.getInstance().isAdminToggled(player.getName())) return vMinecraftChat.adminChat(player, message); - if (vMinecraftSettings.getInstance().isAdminToggled(player.getName())) - return vMinecraftChat.adminChatToggle(player, message); else if (message.startsWith(">")) return vMinecraftChat.quote(player, message);