From 746632121287385aaac51cb4c44eae1bb7f03113 Mon Sep 17 00:00:00 2001 From: Travis Watkins Date: Sat, 16 Mar 2013 08:31:03 -0500 Subject: [PATCH] Limit mob names to 64 chars to avoid client crash. Fixes BUKKIT-3753 --- .../org/bukkit/craftbukkit/entity/CraftLivingEntity.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index 8676a5ff1e..7a7fd39134 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); }