mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-11 16:36:58 -04:00
fix fallback entity name
This commit is contained in:
parent
fddea73f3a
commit
c809357f16
@ -47,7 +47,7 @@ abstract class LivingEntity(connection: PlayConnection, entityType: EntityType,
|
||||
|
||||
|
||||
override val canRaycast: Boolean get() = super.canRaycast && health > 0.0
|
||||
override val name: ChatComponent? get() = super.name ?: connection.language.translate(type.translationKey)
|
||||
override val name: ChatComponent? get() = super.name
|
||||
|
||||
private fun getLivingEntityFlag(bitMask: Int): Boolean {
|
||||
return data.getBitMask(FLAGS_DATA, bitMask, 0x00)
|
||||
|
@ -52,7 +52,11 @@ class EntityNameFeature(renderer: EntityRenderer<*>) : BillboardTextFeature(rend
|
||||
|
||||
private fun Entity.getName(invisible: Boolean): ChatComponent? {
|
||||
if (invisible) return null
|
||||
if (this.isNameVisible) return name
|
||||
if (this.isNameVisible) {
|
||||
var name = this.name
|
||||
if (name == null && this is LivingEntity) name = connection.language.translate(type.translationKey) // TODO: Is that correct?
|
||||
return name
|
||||
}
|
||||
if (!isTargeted()) return null
|
||||
return name
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user