summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorNathan Adams <dinnerbone@dinnerbone.com>2012-01-14 17:42:18 +0000
committerNathan Adams <dinnerbone@dinnerbone.com>2012-01-14 17:42:18 +0000
commit657f458ba7cdfdab45dbaebc8d711c56e3aba774 (patch)
treebf0b1dfeafd095533111ac3a4957edafd447649c /src/main
parentd73c29aad79554400b565d5f795446475c00e311 (diff)
downloadcraftbukkit-657f458ba7cdfdab45dbaebc8d711c56e3aba774.tar
craftbukkit-657f458ba7cdfdab45dbaebc8d711c56e3aba774.tar.gz
craftbukkit-657f458ba7cdfdab45dbaebc8d711c56e3aba774.tar.lz
craftbukkit-657f458ba7cdfdab45dbaebc8d711c56e3aba774.tar.xz
craftbukkit-657f458ba7cdfdab45dbaebc8d711c56e3aba774.zip
Player.setPlayerListName no longer counts colors towards the 16-char limit. Thanks to an (unfortunately old) PR by ZachBora.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 8d99a64c..09584520 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -25,16 +25,7 @@ import net.minecraft.server.Packet61WorldEvent;
import net.minecraft.server.Packet6SpawnPosition;
import net.minecraft.server.Packet70Bed;
import net.minecraft.server.WorldServer;
-import org.bukkit.Achievement;
-import org.bukkit.Effect;
-import org.bukkit.GameMode;
-import org.bukkit.Instrument;
-import org.bukkit.Location;
-import org.bukkit.Material;
-import org.bukkit.Note;
-import org.bukkit.OfflinePlayer;
-import org.bukkit.Statistic;
-import org.bukkit.World;
+import org.bukkit.*;
import org.bukkit.configuration.serialization.DelegateDeserialization;
import org.bukkit.craftbukkit.CraftOfflinePlayer;
import org.bukkit.craftbukkit.CraftServer;
@@ -156,8 +147,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return;
}
- if (name.length() > 16) {
- throw new IllegalArgumentException("Player list names can only be a maximum of 16 characters long");
+ if (ChatColor.stripColor(name).length() > 16) {
+ throw new IllegalArgumentException("Player list names can only be a maximum of 16 characters long without colour codes");
}
// Collisions will make for invisible people