@@ -48,7 +48,7 @@ public class VirtualHologramEntity {
4848 private float headYaw ;
4949 private boolean small = false ;
5050 private boolean marker = false ;
51- private boolean showNametag = false ;
51+ private byte alwaysShowNametag ;
5252
5353 public VirtualHologramEntity (final UserConnection user , final int entityId ) {
5454 this .user = user ;
@@ -99,23 +99,21 @@ public void syncState(final EntityPacketRewriter1_8 entityRewriter, final List<E
9999 // Filter armor stand data to calculate emulation
100100 byte flags = 0 ;
101101 byte armorStandFlags = 0 ;
102- byte nameTagFlags = 0 ;
103102 for (EntityData entityData : entityDataTracker ) {
104103 if (entityData .id () == 0 && entityData .dataType () == EntityDataTypes1_8 .BYTE ) {
105104 flags = ((Number ) entityData .getValue ()).byteValue ();
106105 } else if (entityData .id () == 2 && entityData .dataType () == EntityDataTypes1_8 .STRING ) {
107106 name = entityData .getValue ().toString ();
108107 if (name != null && name .isEmpty ()) name = null ;
108+ } else if (entityData .id () == 3 && entityData .dataType () == EntityDataTypes1_8 .BYTE ) {
109+ alwaysShowNametag = ((Number ) entityData .getValue ()).byteValue ();
109110 } else if (entityData .id () == 10 && entityData .dataType () == EntityDataTypes1_8 .BYTE ) {
110111 armorStandFlags = ((Number ) entityData .getValue ()).byteValue ();
111- } else if (entityData .id () == 3 && entityData .dataType () == EntityDataTypes1_8 .BYTE ) {
112- nameTagFlags = ((Number ) entityData .getValue ()).byteValue ();
113112 }
114113 }
115114 final boolean invisible = (flags & 0x20 ) != 0 ;
116115 small = (armorStandFlags & 0x01 ) != 0 ;
117116 marker = (armorStandFlags & 0x10 ) != 0 ;
118- showNametag = (nameTagFlags & 0x01 ) != 0 ;
119117
120118 State prevState = currentState ;
121119 if (invisible && name != null ) {
@@ -258,7 +256,7 @@ private void writeHologramMeta(PacketWrapper wrapper) {
258256 final List <EntityData > entityDataList = new ArrayList <>();
259257 entityDataList .add (new EntityData (EntityDataIndex1_7_6_10 .ABSTRACT_AGEABLE_AGE .getIndex (), EntityDataTypes1_7_6_10 .INT , -1700000 ));
260258 entityDataList .add (new EntityData (EntityDataIndex1_7_6_10 .LIVING_ENTITY_BASE_NAME_TAG .getIndex (), EntityDataTypes1_7_6_10 .STRING , name ));
261- entityDataList .add (new EntityData (EntityDataIndex1_7_6_10 .LIVING_ENTITY_BASE_NAME_TAG_VISIBILITY .getIndex (), EntityDataTypes1_7_6_10 .BYTE , ( byte ) ( showNametag ? 1 : 0 ) ));
259+ entityDataList .add (new EntityData (EntityDataIndex1_7_6_10 .LIVING_ENTITY_BASE_NAME_TAG_VISIBILITY .getIndex (), EntityDataTypes1_7_6_10 .BYTE , alwaysShowNametag ));
262260
263261 wrapper .write (RewindTypes .ENTITY_DATA_LIST1_7 , entityDataList );
264262 }
0 commit comments