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