summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Broes <erikbroes@grum.nl>2011-03-13 12:52:01 +0100
committerErik Broes <erikbroes@grum.nl>2011-03-13 12:52:01 +0100
commit6043797ce0b23c9bf7f92efd31746c1cd758b2be (patch)
tree4dc2a605e264db4fad1df6a8e9e0795490451683
parent1be1b5ab4d713ce1a7807465e7fc0a4079ac85bd (diff)
downloadcraftbukkit-6043797ce0b23c9bf7f92efd31746c1cd758b2be.tar
craftbukkit-6043797ce0b23c9bf7f92efd31746c1cd758b2be.tar.gz
craftbukkit-6043797ce0b23c9bf7f92efd31746c1cd758b2be.tar.lz
craftbukkit-6043797ce0b23c9bf7f92efd31746c1cd758b2be.tar.xz
craftbukkit-6043797ce0b23c9bf7f92efd31746c1cd758b2be.zip
Fix getDisplayName getting lost when getBukkitEntity is called
-rw-r--r--src/main/java/net/minecraft/server/EntityPlayer.java6
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java6
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 db9b9540..1c532764 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 79a15360..1b3a6222 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