diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2013-03-16 08:31:03 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2013-03-16 08:32:31 -0500 |
commit | 746632121287385aaac51cb4c44eae1bb7f03113 (patch) | |
tree | f8797e0bd0daaacba4f9c12887b7513a17bfe34e /src | |
parent | 4fa8c24e421856bd6eae01137bafacfc8673d1c8 (diff) | |
download | craftbukkit-746632121287385aaac51cb4c44eae1bb7f03113.tar craftbukkit-746632121287385aaac51cb4c44eae1bb7f03113.tar.gz craftbukkit-746632121287385aaac51cb4c44eae1bb7f03113.tar.lz craftbukkit-746632121287385aaac51cb4c44eae1bb7f03113.tar.xz craftbukkit-746632121287385aaac51cb4c44eae1bb7f03113.zip |
Limit mob names to 64 chars to avoid client crash. Fixes BUKKIT-3753
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index 8676a5ff..7a7fd391 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -362,6 +362,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { name = ""; } + // Names cannot be more than 64 characters due to DataWatcher limitations + if (name.length() > 64) { + name = name.substring(0, 64); + } + getHandle().setCustomName(name); } |