1
0
mirror of https://github.com/mcMMO-Dev/mcMMO.git synced 2026-02-20 02:33:15 +01:00

Created a wrapper for Player.sendMessage() That automatically applies Quake Colors and Word Wrap

This commit is contained in:
cerevisiae
2010-12-01 12:36:42 -06:00
parent 535c42be0b
commit 9713bdc2a5
2 changed files with 27 additions and 49 deletions

View File

@@ -318,18 +318,7 @@ public class vMinecraftCommands{
log.log(Level.INFO, player.getName()+" fabulously said \""+ str+"\"");
//Prepend the player name and cut into lines.
String[] message = vMinecraftChat.wordWrap(playerName + str);
//Output the message
for(String msg: message)
{
if (msg.contains(playerName))
vMinecraftChat.gmsg( playerName
+ vMinecraftChat.rainbow(
msg.substring(playerName.length())));
else
vMinecraftChat.gmsg(vMinecraftChat.rainbow(msg));
}
vMinecraftChat.gmsg(playerName + vMinecraftChat.rainbow(str));
return EXIT_SUCCESS;
}
@@ -420,11 +409,10 @@ public class vMinecraftCommands{
e.printStackTrace();
}
int maxPlayers = server.getInt("max-players");
//Output the player list
String[] tempOut = vMinecraftChat.wordWrap(Colors.Rose + "Player List ("
vMinecraftChat.sendMessage(player, Colors.Rose + "Player List ("
+ count + "/" + maxPlayers +"): " + tempList);
for(String msg: tempOut)
player.sendMessage( msg );
return EXIT_SUCCESS;
}