From d9bdfa4aa24301e2e9682135c7ec543d08006dcd Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 1 Jul 2020 03:13:57 -0400 Subject: [PATCH] Fix supporting more places of the old UUID format Fixes #3734 --- .../Fix-client-rendering-skulls-from-same-user.patch | 4 ++-- .../Support-old-UUID-format-for-NBT.patch | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Spigot-Server-Patches/Fix-client-rendering-skulls-from-same-user.patch b/Spigot-Server-Patches/Fix-client-rendering-skulls-from-same-user.patch index 954b9d325e..0df1a6363c 100644 --- a/Spigot-Server-Patches/Fix-client-rendering-skulls-from-same-user.patch +++ b/Spigot-Server-Patches/Fix-client-rendering-skulls-from-same-user.patch @@ -39,8 +39,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start + if (nbttagcompound != null && nbttagcompound.hasKeyOfType("SkullOwner", 10)) { + NBTTagCompound owner = nbttagcompound.getCompound("SkullOwner"); -+ if (owner.hasKey("Id")) { -+ nbttagcompound.map.put("SkullOwnerOrig", owner.map.get("Id")); ++ if (owner.hasUUID("Id")) { ++ nbttagcompound.setUUID("SkullOwnerOrig", owner.getUUID("Id")); + TileEntitySkull.sanitizeUUID(owner); + } + } diff --git a/Spigot-Server-Patches/Support-old-UUID-format-for-NBT.patch b/Spigot-Server-Patches/Support-old-UUID-format-for-NBT.patch index f808153712..2d88b65f2a 100644 --- a/Spigot-Server-Patches/Support-old-UUID-format-for-NBT.patch +++ b/Spigot-Server-Patches/Support-old-UUID-format-for-NBT.patch @@ -23,3 +23,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return GameProfileSerializer.a(this.get(s)); } + public final boolean hasUUID(String s) { return this.b(s); } // Paper - OBFHELPER + public boolean b(String s) { ++ // Paper start - support old format ++ if (hasKey(s + "Least") && hasKey(s + "Most")) { ++ return true; ++ } ++ // Paper end + NBTBase nbtbase = this.get(s); + + return nbtbase != null && nbtbase.b() == NBTTagIntArray.a && ((NBTTagIntArray) nbtbase).getInts().length == 4;