mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-07 11:05:13 +01:00
SPIGOT-4022: Improve utility of Entity.getName for non-players
This commit is contained in:
parent
f03c10c185
commit
fa1340f7a6
2 changed files with 6 additions and 1 deletions
|
@ -568,7 +568,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return getHandle().getName();
|
return CraftChatMessage.fromComponent(getHandle().getDisplayName(), EnumChatFormat.WHITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -92,6 +92,11 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||||
return getHandle().sleepTicks;
|
return getHandle().sleepTicks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return getHandle().getName();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isOp() {
|
public boolean isOp() {
|
||||||
return op;
|
return op;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue