From 4137337365b3e9bb33d78efea241fa299add6e15 Mon Sep 17 00:00:00 2001 From: Pyrbu Date: Wed, 31 Jan 2024 07:02:32 +0100 Subject: [PATCH] make 1.19+ tab display name consistent with below --- .../java/lol/pyr/znpcsplus/packets/V1_19_3PacketFactory.java | 3 ++- .../main/java/lol/pyr/znpcsplus/packets/V1_8PacketFactory.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/plugin/src/main/java/lol/pyr/znpcsplus/packets/V1_19_3PacketFactory.java b/plugin/src/main/java/lol/pyr/znpcsplus/packets/V1_19_3PacketFactory.java index f1fe5e3..22fe62d 100644 --- a/plugin/src/main/java/lol/pyr/znpcsplus/packets/V1_19_3PacketFactory.java +++ b/plugin/src/main/java/lol/pyr/znpcsplus/packets/V1_19_3PacketFactory.java @@ -30,7 +30,8 @@ public class V1_19_3PacketFactory extends V1_17PacketFactory { CompletableFuture 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); diff --git a/plugin/src/main/java/lol/pyr/znpcsplus/packets/V1_8PacketFactory.java b/plugin/src/main/java/lol/pyr/znpcsplus/packets/V1_8PacketFactory.java index 05338e4..4fd6874 100644 --- a/plugin/src/main/java/lol/pyr/znpcsplus/packets/V1_8PacketFactory.java +++ b/plugin/src/main/java/lol/pyr/znpcsplus/packets/V1_8PacketFactory.java @@ -96,7 +96,8 @@ public class V1_8PacketFactory implements PacketFactory { CompletableFuture 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); });