From 8806d0a89ae2b68618c7f2f0c55e3233e66e6ca0 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 28 Jun 2020 20:33:14 -0400 Subject: [PATCH] Fix case where some skulls still have string UUID's These heads are technically outdated, but this patch shouldn't care about what format the original value was in, so keep it the same. --- .../0266-Fix-client-rendering-skulls-from-same-user.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Spigot-Server-Patches/0266-Fix-client-rendering-skulls-from-same-user.patch b/Spigot-Server-Patches/0266-Fix-client-rendering-skulls-from-same-user.patch index 2fd129960..a2d801109 100644 --- a/Spigot-Server-Patches/0266-Fix-client-rendering-skulls-from-same-user.patch +++ b/Spigot-Server-Patches/0266-Fix-client-rendering-skulls-from-same-user.patch @@ -25,7 +25,7 @@ index 7b2010ec4955fb5788c60178c6e306ea3098e9ba..95e801a9a7ca405ff7e80c920fa78493 private Entity k; private ShapeDetectorBlock l; diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java -index 6e049c2e2a142ce022b9dc278a3bb302f723e42c..a7560ac0719d789f2b8ebc0294190a9bd43a2512 100644 +index 6e049c2e2a142ce022b9dc278a3bb302f723e42c..91235f7bc80967a759ed8bb25d74ff0af6e25ef4 100644 --- a/src/main/java/net/minecraft/server/PacketDataSerializer.java +++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java @@ -274,9 +274,18 @@ public class PacketDataSerializer extends ByteBuf { @@ -40,7 +40,7 @@ index 6e049c2e2a142ce022b9dc278a3bb302f723e42c..a7560ac0719d789f2b8ebc0294190a9b + if (nbttagcompound != null && nbttagcompound.hasKeyOfType("SkullOwner", 10)) { + NBTTagCompound owner = nbttagcompound.getCompound("SkullOwner"); + if (owner.hasKey("Id")) { -+ nbttagcompound.setUUID("SkullOwnerOrig", owner.getUUID("Id")); ++ nbttagcompound.map.put("SkullOwnerOrig", owner.map.get("Id")); + TileEntitySkull.sanitizeUUID(owner); + } + } @@ -56,8 +56,8 @@ index 6e049c2e2a142ce022b9dc278a3bb302f723e42c..a7560ac0719d789f2b8ebc0294190a9b + // Paper start - Fix skulls of same owner - restore orig ID since we changed it on send to client + if (itemstack.tag.hasKey("SkullOwnerOrig")) { + NBTTagCompound owner = itemstack.tag.getCompound("SkullOwner"); -+ if (itemstack.tag.hasUUID("SkullOwnerOrig")) { -+ owner.setUUID("Id", itemstack.tag.getUUID("SkullOwnerOrig")); ++ if (itemstack.tag.hasKey("SkullOwnerOrig")) { ++ owner.map.put("Id", itemstack.tag.map.get("SkullOwnerOrig")); + itemstack.tag.remove("SkullOwnerOrig"); + } + }