summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsk89q <the.sk89q@gmail.com>2011-09-26 15:10:33 -0700
committersk89q <the.sk89q@gmail.com>2011-09-26 15:10:33 -0700
commitd38c63837f9400719767701e26d4f21564017ffa (patch)
tree8ca0ddc589fd56662c7fb20700276c01bfbfec54 /src
parentb76a86b572a4ccce5cbdc0d977eb7d2b78f1047d (diff)
downloadbukkit-d38c63837f9400719767701e26d4f21564017ffa.tar
bukkit-d38c63837f9400719767701e26d4f21564017ffa.tar.gz
bukkit-d38c63837f9400719767701e26d4f21564017ffa.tar.lz
bukkit-d38c63837f9400719767701e26d4f21564017ffa.tar.xz
bukkit-d38c63837f9400719767701e26d4f21564017ffa.zip
Added Player.get/setListName to change the name of the player on the player list.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/entity/Player.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 1791c743..44239994 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -36,6 +36,31 @@ public interface Player extends HumanEntity, CommandSender, OfflinePlayer {
* @param name The new display name.
*/
public void setDisplayName(String name);
+
+ /**
+ * Gets the name that is shown on the player list.
+ *
+ * @return the player list name
+ */
+ public String getListName();
+
+ /**
+ * Sets the name that is shown on the player list. The name cannot
+ * be longer than 16 characters, but color is supported. If the same
+ * name is passed (with no change), then nothing will happen.
+ * Case-sensitivity matters -- two names with different casing will
+ * appear as two different people. If a player joins afterwards with
+ * a name that conflicts with a player's custom list name, the
+ * joining player's player list name will have a random number appended to it
+ * (1-2 characters long in the default implementation). If the joining
+ * player's name is 15 or 16 characters long, part of the name will
+ * be truncated at the end to allow the addition of the two digits.
+ *
+ * @param name new player list name
+ * @throws IllegalArgumentException if the name is already used by someone else
+ * @throws IllegalArgumentException if the length of the name is too long
+ */
+ public void setListName(String name);
/**
* Set the target of the player's compass.