From eecd80be1c5f8049ab520515bd4a847dae3334ed Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sun, 14 Jul 2024 16:04:14 +0100 Subject: [PATCH] Fixed display name --- .../eco/internal/spigot/proxy/v1_21/DisplayName.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/eco-core/core-nms/v1_21/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_21/DisplayName.kt b/eco-core/core-nms/v1_21/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_21/DisplayName.kt index 3ec0281e..c78fd941 100644 --- a/eco-core/core-nms/v1_21/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_21/DisplayName.kt +++ b/eco-core/core-nms/v1_21/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_21/DisplayName.kt @@ -43,15 +43,13 @@ class DisplayName : DisplayNameProxy { val nmsComponent = displayName.toNMS() val nmsEntity = entity.handle - nmsEntity.isCustomNameVisible - val entityData = SynchedEntityData.Builder(nmsEntity).build() - - entityData.set(displayNameAccessor, Optional.of(nmsComponent), true) - entityData.set(customNameVisibleAccessor, visible, true) val packet = ClientboundSetEntityDataPacket( nmsEntity.id, - entityData.packDirty() ?: throw IllegalStateException("No packed entity data") + listOf( + SynchedEntityData.DataValue.create(displayNameAccessor, Optional.of(nmsComponent)), + SynchedEntityData.DataValue.create(customNameVisibleAccessor, visible) + ) ) player.sendPacket(Packet(packet))