From 201bcceaabef0ed8ce75e6f8a3227dce5f3fe668 Mon Sep 17 00:00:00 2001 From: LoJoSho Date: Thu, 20 Apr 2023 14:12:25 -0500 Subject: [PATCH] fix: 1.19.3 fake info packet not properly casting in protocol lib --- .../util/packets/PacketManager.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/util/packets/PacketManager.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/util/packets/PacketManager.java index a789f3c1..ec24e1bd 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/util/packets/PacketManager.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/util/packets/PacketManager.java @@ -306,16 +306,19 @@ public class PacketManager extends BasePacket { WrappedGameProfile wrappedGameProfile = new WrappedGameProfile(uuid, name); WrappedSignedProperty skinData = PlayerUtils.getSkin(skinnedPlayer); if (skinData != null) wrappedGameProfile.getProperties().put("textures", skinData); - if (NMSHandlers.getVersion().contains("v1_17_R1") || NMSHandlers.getVersion().contains("v1_18_R2") || NMSHandlers.getVersion().contains("v1_19_R1") || NMSHandlers.getVersion().contains("v1_19_R3")) { - info.getHandle().getPlayerInfoDataLists().write(1, Collections.singletonList(new PlayerInfoData( - wrappedGameProfile, - 0, - EnumWrappers.NativeGameMode.CREATIVE, - WrappedChatComponent.fromText(name) - ))); + // There was a temp solution to 1.19.2, but was eventually fixed somewhere. All versions can just use the following, + //if (NMSHandlers.getVersion().contains("v1_17_R1") || NMSHandlers.getVersion().contains("v1_18_R2") || NMSHandlers.getVersion().contains("v1_19_R1") || NMSHandlers.getVersion().contains("v1_19_R3")) { + info.getHandle().getPlayerInfoDataLists().write(1, Collections.singletonList(new PlayerInfoData( + wrappedGameProfile, + 0, + EnumWrappers.NativeGameMode.CREATIVE, + WrappedChatComponent.fromText(name) + ))); + /* } else { info.setData(List.of(new PlayerInfoData(wrappedGameProfile, 0, EnumWrappers.NativeGameMode.CREATIVE, WrappedChatComponent.fromText(name)))); } + */ for (final Player p : sendTo) sendPacket(p, info.getHandle()); }