Commits

md_5 authored f5d891f609a
SPIGOT-2537: Relax skull check even for nominally invalid skulls.
No tags

nms-patches/ItemSkull.patch

Modified
1 1 --- a/net/minecraft/server/ItemSkull.java
2 2 +++ b/net/minecraft/server/ItemSkull.java
3 -@@ -117,6 +117,20 @@
3 +@@ -117,6 +117,15 @@
4 4 nbttagcompound.set("SkullOwner", GameProfileSerializer.serialize(new NBTTagCompound(), gameprofile));
5 5 return true;
6 6 } else {
7 7 + // CraftBukkit start
8 -+ boolean valid = true;
9 -+
10 8 + NBTTagList textures = nbttagcompound.getCompound("SkullOwner").getCompound("Properties").getList("textures", 10); // Safe due to method contracts
11 9 + for (int i = 0; i < textures.size(); i++) {
12 -+ if (textures.get(i) instanceof NBTTagCompound && !((NBTTagCompound) textures.get(i)).hasKeyOfType("Signature", 8)) {
13 -+ valid = false;
10 ++ if (textures.get(i) instanceof NBTTagCompound && !((NBTTagCompound) textures.get(i)).hasKeyOfType("Signature", 8) && ((NBTTagCompound) textures.get(i)).getString("Value").trim().isEmpty()) {
11 ++ nbttagcompound.remove("SkullOwner");
12 ++ break;
14 13 + }
15 14 + }
16 -+
17 -+ if (!valid) {
18 -+ nbttagcompound.remove("SkullOwner");
19 -+ }
20 15 + // CraftBukkit end
21 16 return false;
22 17 }
23 18 }

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut