Commits
md_5 authored f5d891f609a
1 1 | --- a/net/minecraft/server/ItemSkull.java |
2 2 | +++ b/net/minecraft/server/ItemSkull.java |
3 - | |
3 + | |
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 | } |