mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
Implemented Player.getDisplayName/setDisplayName
By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
4cd2b9af93
commit
d7d4579cf4
1 changed files with 10 additions and 1 deletions
|
@ -7,11 +7,12 @@ import org.bukkit.Location;
|
||||||
import org.bukkit.Player;
|
import org.bukkit.Player;
|
||||||
|
|
||||||
public class CraftPlayer extends CraftHumanEntity implements Player {
|
public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
|
|
||||||
private EntityPlayerMP entity;
|
private EntityPlayerMP entity;
|
||||||
|
private String name;
|
||||||
|
|
||||||
public CraftPlayer(CraftServer server, EntityPlayerMP entity) {
|
public CraftPlayer(CraftServer server, EntityPlayerMP entity) {
|
||||||
super(server, entity);
|
super(server, entity);
|
||||||
|
this.name = getName();
|
||||||
this.entity = entity;
|
this.entity = entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,6 +48,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
entity.a.a(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
entity.a.a(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDisplayName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getDisplayName(final String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "CraftPlayer{" + "name=" + getName() + '}';
|
return "CraftPlayer{" + "name=" + getName() + '}';
|
||||||
|
|
Loading…
Reference in a new issue