remove custom names from non-living

This commit is contained in:
Sen 2025-08-02 20:53:00 +02:00
parent f29623eec6
commit 50fec6dd56
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
46 changed files with 290 additions and 511 deletions

View file

@ -1147,7 +1147,7 @@ public class Client implements IThreadListener {
if(entity.vehicle instanceof EntityLiving living) {
int vh = living.getHealth();
int vhMax = living.getMaxHealth();
y = this.drawStat(x, y, living.getDisplayName(), vh, vhMax, 0xff6060);
y = this.drawStat(x, y, living.getLabel(), vh, vhMax, 0xff6060);
}
if(entity.getManaPoints() > 0) {
int mana = entity.getManaPoints();
@ -1191,7 +1191,7 @@ public class Client implements IThreadListener {
}
else if(this.pointed != null && this.pointed.type == ObjectType.ENTITY && this.pointed.entity != null) {
Entity entity = this.pointed.entity;
desc = (entity instanceof EntityNPC npc ? (!npc.canCounter(this.player) ? Color.GREEN : (npc.canAttack(this.player) ? Color.RED : Color.BLUE)) : Color.LIGHT_GRAY) + entity.getCommandName();
desc = (entity instanceof EntityNPC npc ? (!npc.canCounter(this.player) ? Color.GREEN : (npc.canAttack(this.player) ? Color.RED : Color.BLUE)) : Color.LIGHT_GRAY) + entity.getRawName();
line1 = entity.getInfo(this.player);
line2 = Color.CYAN + EntityRegistry.getEntityName(EntityRegistry.getEntityString(entity));
if(entity instanceof EntityLiving living) {
@ -1973,7 +1973,7 @@ public class Client implements IThreadListener {
+ (entity.isWet() ? "W" : "") + (entity.canAttackWithItem() ? "A" : "")
+ (entity.passenger != null ? "H" : "") + (entity.vehicle != null ? "R" : "")
+ (entity.doesEntityNotTriggerPressurePlate() ? "L" : "") + "\n" +
(entity.hasCustomName() ? "Name: '" + Color.stripCodes(entity.getCustomNameTag()) + "'" : "Name: n/a")
(entity instanceof EntityLiving living && living.hasCustomName() ? "Name: '" + Color.stripCodes(living.getCustomNameTag()) + "'" : "Name: n/a")
;
}

View file

@ -28,7 +28,7 @@ public abstract class Render<T extends Entity>
protected void renderName(T entity, double x, double y, double z)
{
String name = entity.getDisplayName();
String name = entity.getLabel();
if(name != null && !name.isEmpty())
this.manager.renderLabel(entity, name, x, y, z, 64);
}

View file

@ -66,7 +66,7 @@ public class RenderXp extends Render<EntityXp> {
protected void renderName(EntityXp entity, double x, double y, double z)
{
String name = entity.getDisplayName();
String name = entity.getLabel();
if(name != null && !name.isEmpty())
this.manager.renderLabel(entity, name, x, y - 0.5, z, 64);
}

View file

@ -500,7 +500,7 @@ public abstract class RendererLivingEntity<T extends EntityLiving> extends Rende
public void renderName(T entity, double x, double y, double z)
{
String name = entity.getDisplayName();
String name = entity.getLabel();
if(name != null && !name.isEmpty())
this.manager.renderLabel(entity, name, x, entity.isSneakingVisually() ? y - 0.25 : y, z, 64);
if(entity.isEntityAlive())