make 1.19+ tab display name consistent with below

This commit is contained in:
Pyrbu 2024-01-31 07:02:32 +01:00
parent cb419227d7
commit 4137337365
2 changed files with 4 additions and 2 deletions

@ -30,7 +30,8 @@ public class V1_19_3PacketFactory extends V1_17PacketFactory {
CompletableFuture<Void> future = new CompletableFuture<>();
skinned(player, properties, new UserProfile(entity.getUuid(), Integer.toString(entity.getEntityId()))).thenAccept(profile -> {
WrapperPlayServerPlayerInfoUpdate.PlayerInfo info = new WrapperPlayServerPlayerInfoUpdate.PlayerInfo(
profile, false, 1, GameMode.CREATIVE, Component.text(" "), null);
profile, false, 1, GameMode.CREATIVE,
Component.text(configManager.getConfig().tabDisplayName().replace("{id}", Integer.toString(entity.getEntityId()))), null);
sendPacket(player, new WrapperPlayServerPlayerInfoUpdate(EnumSet.of(WrapperPlayServerPlayerInfoUpdate.Action.ADD_PLAYER,
WrapperPlayServerPlayerInfoUpdate.Action.UPDATE_LISTED), info, info));
future.complete(null);

@ -96,7 +96,8 @@ public class V1_8PacketFactory implements PacketFactory {
CompletableFuture<Void> future = new CompletableFuture<>();
skinned(player, properties, new UserProfile(entity.getUuid(), Integer.toString(entity.getEntityId()))).thenAccept(profile -> {
sendPacket(player, new WrapperPlayServerPlayerInfo(
WrapperPlayServerPlayerInfo.Action.ADD_PLAYER, new WrapperPlayServerPlayerInfo.PlayerData(Component.text(configManager.getConfig().tabDisplayName().replace("{id}", Integer.toString(entity.getEntityId()))),
WrapperPlayServerPlayerInfo.Action.ADD_PLAYER, new WrapperPlayServerPlayerInfo.PlayerData(
Component.text(configManager.getConfig().tabDisplayName().replace("{id}", Integer.toString(entity.getEntityId()))),
profile, GameMode.CREATIVE, 1)));
future.complete(null);
});