From a12a6778592911a2cff28b353a294c66902ba8bf Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 3 Jul 2020 02:16:51 -0400 Subject: [PATCH] Support String UUID's in old player skulls Should fix remaining skull issues for people with unconverted old skulls. Fixes #3734 --- .../0527-Support-old-UUID-format-for-NBT.patch | 16 ++++++++++++++++ ...an-up-duplicated-GameProfile-Properties.patch | 8 ++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Spigot-Server-Patches/0527-Support-old-UUID-format-for-NBT.patch b/Spigot-Server-Patches/0527-Support-old-UUID-format-for-NBT.patch index 40a62a960..dd0cf3994 100644 --- a/Spigot-Server-Patches/0527-Support-old-UUID-format-for-NBT.patch +++ b/Spigot-Server-Patches/0527-Support-old-UUID-format-for-NBT.patch @@ -7,6 +7,22 @@ We have stored UUID in plenty of places that did not get DFU'd So just look for old format and load it if it exists. +diff --git a/src/main/java/net/minecraft/server/GameProfileSerializer.java b/src/main/java/net/minecraft/server/GameProfileSerializer.java +index 66d503a91665952b98c8cdc06c9ad10782b0558b..dca47422816e0ff5cf56ee73d0aa7e2f74a48060 100644 +--- a/src/main/java/net/minecraft/server/GameProfileSerializer.java ++++ b/src/main/java/net/minecraft/server/GameProfileSerializer.java +@@ -28,6 +28,11 @@ public final class GameProfileSerializer { + s = nbttagcompound.getString("Name"); + } + ++ // Paper start - support string UUID's ++ if (nbttagcompound.hasKeyOfType("Id", 8)) { ++ uuid = UUID.fromString(nbttagcompound.getString("Id")); ++ } ++ // Paper end + if (nbttagcompound.b("Id")) { + uuid = nbttagcompound.a("Id"); + } diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java index f608b35502890650adfc1df35e0794471f57ecbc..436f40bcd7817bedde4f6570c7c47dba7ff7034f 100644 --- a/src/main/java/net/minecraft/server/NBTTagCompound.java diff --git a/Spigot-Server-Patches/0528-Clean-up-duplicated-GameProfile-Properties.patch b/Spigot-Server-Patches/0528-Clean-up-duplicated-GameProfile-Properties.patch index 8b8ff3729..5d2c684b6 100644 --- a/Spigot-Server-Patches/0528-Clean-up-duplicated-GameProfile-Properties.patch +++ b/Spigot-Server-Patches/0528-Clean-up-duplicated-GameProfile-Properties.patch @@ -9,10 +9,10 @@ growing to large sizes and preventing login. This now automatically cleans up the extra properties. diff --git a/src/main/java/net/minecraft/server/GameProfileSerializer.java b/src/main/java/net/minecraft/server/GameProfileSerializer.java -index 66d503a91665952b98c8cdc06c9ad10782b0558b..488c3473c9e56913d382c2d9957582634f3f3d85 100644 +index dca47422816e0ff5cf56ee73d0aa7e2f74a48060..1fe44d4a1a1895f5715c720f9d7d7acb10e50f61 100644 --- a/src/main/java/net/minecraft/server/GameProfileSerializer.java +++ b/src/main/java/net/minecraft/server/GameProfileSerializer.java -@@ -42,8 +42,8 @@ public final class GameProfileSerializer { +@@ -47,8 +47,8 @@ public final class GameProfileSerializer { while (iterator.hasNext()) { String s1 = (String) iterator.next(); NBTTagList nbttaglist = nbttagcompound1.getList(s1, 10); @@ -23,7 +23,7 @@ index 66d503a91665952b98c8cdc06c9ad10782b0558b..488c3473c9e56913d382c2d995758263 NBTTagCompound nbttagcompound2 = nbttaglist.getCompound(i); String s2 = nbttagcompound2.getString("Value"); -@@ -229,7 +229,7 @@ public final class GameProfileSerializer { +@@ -234,7 +234,7 @@ public final class GameProfileSerializer { Optional optional = iblockstate.b(nbttagcompound.getString(s)); if (optional.isPresent()) { @@ -32,7 +32,7 @@ index 66d503a91665952b98c8cdc06c9ad10782b0558b..488c3473c9e56913d382c2d995758263 } else { GameProfileSerializer.LOGGER.warn("Unable to read property: {} with value: {} for blockstate: {}", s, nbttagcompound.getString(s), nbttagcompound1.toString()); return s0; -@@ -259,8 +259,8 @@ public final class GameProfileSerializer { +@@ -264,8 +264,8 @@ public final class GameProfileSerializer { return nbttagcompound; }