Redoing vMinecraftChat.getName()

This commit is contained in:
cerevisiae 2010-12-09 20:09:42 -06:00
parent 370e8d2b36
commit 56c0805fca
3 changed files with 47 additions and 8 deletions

View File

@ -212,18 +212,24 @@ public class vMinecraftChat {
//===================================================================== //=====================================================================
public static String getName(Player player){ public static String getName(Player player){
//Get the prefix //Add the nickname or the name if there is none
String playerPrefix = player.getPrefix(); String output = vMinecraftUsers.getProfile(player).getNick();
//Add the name if(output.isEmpty())
String output = player.getName(); output = player.getName();
//Add the color if there is one //Add the color if there is one
if(player.getColor() != null && player.getColor() != "") if(player.getColor() != null && player.getColor() != "")
output = player.getColor().substring(0,2) + output; output = player.getColor().substring(0,2) + output;
//Add the tag if there is one //Add the tag if there is one
if(playerPrefix != null && !playerPrefix.isEmpty()) output = vMinecraftUsers.getProfile(player).getTag() + output;
output = applyColors(playerPrefix.substring(1)) + output;
//Add the suffix if there is one
output += vMinecraftUsers.getProfile(player).getSuffix();
/*if(playerPrefix != null && !playerPrefix.isEmpty())
output = applyColors(playerPrefix.substring(1)) + output;*/
//Return the name //Return the name
return output; return output;

View File

@ -170,6 +170,7 @@ public class vMinecraftCommands{
.globalmessages()); .globalmessages());
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
//===================================================================== //=====================================================================
//Function: prefix (/prefix) //Function: prefix (/prefix)
//Input: Player player: The player using the command //Input: Player player: The player using the command

View File

@ -397,6 +397,38 @@ class PlayerList
//===================================================================== //=====================================================================
public String getTag() { return tag; } public String getTag() { return tag; }
//=====================================================================
//Function: setNick
//Input: String newTag: The nickname to set for the player
//Output: None
//Use: Sets a player nickname
//=====================================================================
public void setNick(String newNick){ nickName = newNick; }
//=====================================================================
//Function: getNick
//Input: None
//Output: String: The player nickname
//Use: Gets a player nickname
//=====================================================================
public String getNick() { return nickName; }
//=====================================================================
//Function: setSuffix
//Input: String newTag: The suffix to set for the player
//Output: None
//Use: Sets a player suffix
//=====================================================================
public void setSuffix(String newSuffix){ suffix = newSuffix; }
//=====================================================================
//Function: getSuffix
//Input: None
//Output: String: The player suffix
//Use: Gets a player suffix
//=====================================================================
public String getSuffix() { return suffix; }
//===================================================================== //=====================================================================
//Function: setMessage //Function: setMessage
//Input: String newName: The name of the player they last messaged //Input: String newName: The name of the player they last messaged