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.
This commit is contained in:
Aikar 2020-06-28 20:33:14 -04:00
parent 9747174b40
commit 8e46a01608

View file

@ -40,7 +40,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ 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 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // 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");
+ }
+ }