@@ -48,7 +48,7 @@ public class VirtualHologramEntity {
48
48
private float headYaw ;
49
49
private boolean small = false ;
50
50
private boolean marker = false ;
51
- private boolean showNametag = false ;
51
+ private byte alwaysShowNametag ;
52
52
53
53
public VirtualHologramEntity (final UserConnection user , final int entityId ) {
54
54
this .user = user ;
@@ -99,23 +99,21 @@ public void syncState(final EntityPacketRewriter1_8 entityRewriter, final List<E
99
99
// Filter armor stand data to calculate emulation
100
100
byte flags = 0 ;
101
101
byte armorStandFlags = 0 ;
102
- byte nameTagFlags = 0 ;
103
102
for (EntityData entityData : entityDataTracker ) {
104
103
if (entityData .id () == 0 && entityData .dataType () == EntityDataTypes1_8 .BYTE ) {
105
104
flags = ((Number ) entityData .getValue ()).byteValue ();
106
105
} else if (entityData .id () == 2 && entityData .dataType () == EntityDataTypes1_8 .STRING ) {
107
106
name = entityData .getValue ().toString ();
108
107
if (name != null && name .isEmpty ()) name = null ;
108
+ } else if (entityData .id () == 3 && entityData .dataType () == EntityDataTypes1_8 .BYTE ) {
109
+ alwaysShowNametag = ((Number ) entityData .getValue ()).byteValue ();
109
110
} else if (entityData .id () == 10 && entityData .dataType () == EntityDataTypes1_8 .BYTE ) {
110
111
armorStandFlags = ((Number ) entityData .getValue ()).byteValue ();
111
- } else if (entityData .id () == 3 && entityData .dataType () == EntityDataTypes1_8 .BYTE ) {
112
- nameTagFlags = ((Number ) entityData .getValue ()).byteValue ();
113
112
}
114
113
}
115
114
final boolean invisible = (flags & 0x20 ) != 0 ;
116
115
small = (armorStandFlags & 0x01 ) != 0 ;
117
116
marker = (armorStandFlags & 0x10 ) != 0 ;
118
- showNametag = (nameTagFlags & 0x01 ) != 0 ;
119
117
120
118
State prevState = currentState ;
121
119
if (invisible && name != null ) {
@@ -258,7 +256,7 @@ private void writeHologramMeta(PacketWrapper wrapper) {
258
256
final List <EntityData > entityDataList = new ArrayList <>();
259
257
entityDataList .add (new EntityData (EntityDataIndex1_7_6_10 .ABSTRACT_AGEABLE_AGE .getIndex (), EntityDataTypes1_7_6_10 .INT , -1700000 ));
260
258
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 ));
262
260
263
261
wrapper .write (RewindTypes .ENTITY_DATA_LIST1_7 , entityDataList );
264
262
}
0 commit comments