From 6043797ce0b23c9bf7f92efd31746c1cd758b2be Mon Sep 17 00:00:00 2001 From: Erik Broes Date: Sun, 13 Mar 2011 12:52:01 +0100 Subject: [PATCH] Fix getDisplayName getting lost when getBukkitEntity is called --- src/main/java/net/minecraft/server/EntityPlayer.java | 6 ++++++ .../java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 6 ++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java index db9b954008..1c53276409 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -50,8 +50,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.name = s; this.c = iteminworldmanager; this.height = 0.0F; + + // CraftBukkit start + this.displayName = this.name; } + public String displayName; + // CraftBukkit end + public void l() { this.activeContainer.a((ICrafting) this); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 79a153600c..1b3a6222c2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -17,11 +17,9 @@ import org.bukkit.craftbukkit.TextWrapper; import org.bukkit.entity.Player; public class CraftPlayer extends CraftHumanEntity implements Player { - private String name; public CraftPlayer(CraftServer server, EntityPlayer entity) { super(server, entity); - name = getName(); } public boolean isOp() { @@ -88,11 +86,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public String getDisplayName() { - return name; + return getHandle().displayName; } public void setDisplayName(final String name) { - this.name = name; + getHandle().displayName = name; } @Override