From 38ebaa53e1e0c299e5f5a84a808d5f8c82df4175 Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Mon, 16 May 2011 21:36:16 -0400 Subject: [PATCH] Limit human entity name length to 16 characters, as per the spec. --- src/main/java/net/minecraft/server/EntityTrackerEntry.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java index b5156c16b0..e1ba68f932 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java @@ -198,6 +198,11 @@ public class EntityTrackerEntry { entityitem.locZ = (double) packet21pickupspawn.d / 32.0D; return packet21pickupspawn; } else if (this.tracker instanceof EntityPlayer) { + // CraftBukkit start - limit name length to 16 characters + if (((EntityHuman) this.tracker).name.length() > 16) { + ((EntityHuman) this.tracker).name = ((EntityHuman) this.tracker).name.substring(0, 16); + } + // CraftBukkit end return new Packet20NamedEntitySpawn((EntityHuman) this.tracker); } else { if (this.tracker instanceof EntityMinecart) {