mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-11 01:12:47 +01:00
Fix getDisplayName getting lost when getBukkitEntity is called
This commit is contained in:
parent
1be1b5ab4d
commit
6043797ce0
2 changed files with 8 additions and 4 deletions
|
@ -50,8 +50,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||||
this.name = s;
|
this.name = s;
|
||||||
this.c = iteminworldmanager;
|
this.c = iteminworldmanager;
|
||||||
this.height = 0.0F;
|
this.height = 0.0F;
|
||||||
|
|
||||||
|
// CraftBukkit start
|
||||||
|
this.displayName = this.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String displayName;
|
||||||
|
// CraftBukkit end
|
||||||
|
|
||||||
public void l() {
|
public void l() {
|
||||||
this.activeContainer.a((ICrafting) this);
|
this.activeContainer.a((ICrafting) this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,11 +17,9 @@ import org.bukkit.craftbukkit.TextWrapper;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class CraftPlayer extends CraftHumanEntity implements Player {
|
public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
private String name;
|
|
||||||
|
|
||||||
public CraftPlayer(CraftServer server, EntityPlayer entity) {
|
public CraftPlayer(CraftServer server, EntityPlayer entity) {
|
||||||
super(server, entity);
|
super(server, entity);
|
||||||
name = getName();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isOp() {
|
public boolean isOp() {
|
||||||
|
@ -88,11 +86,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDisplayName() {
|
public String getDisplayName() {
|
||||||
return name;
|
return getHandle().displayName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDisplayName(final String name) {
|
public void setDisplayName(final String name) {
|
||||||
this.name = name;
|
getHandle().displayName = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue