This commit is contained in:
cerevisiae 2010-12-01 00:56:52 -06:00
parent b2c33b779d
commit acf1b5261d
2 changed files with 7 additions and 24 deletions

View File

@ -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()) {
@ -273,26 +277,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
//Input: Player player: The player talking

View File

@ -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);