craftbukkit/nms-patches/net/minecraft/world/item/ItemSkullPlayer.patch

20 lines
1,009 B
Diff
Raw Normal View History

2021-03-16 09:00:00 +11:00
--- a/net/minecraft/world/item/ItemSkullPlayer.java
+++ b/net/minecraft/world/item/ItemSkullPlayer.java
2021-06-11 15:00:00 +10:00
@@ -51,6 +51,16 @@
2021-11-22 09:00:00 +11:00
TileEntitySkull.updateGameprofile(gameprofile, (gameprofile1) -> {
nbttagcompound.put("SkullOwner", GameProfileSerializer.writeGameProfile(new NBTTagCompound(), gameprofile1));
2021-06-11 15:00:00 +10:00
});
2016-07-13 11:47:57 +10:00
+ // CraftBukkit start
2021-06-11 15:00:00 +10:00
+ } else {
2021-03-16 09:00:00 +11:00
+ net.minecraft.nbt.NBTTagList textures = nbttagcompound.getCompound("SkullOwner").getCompound("Properties").getList("textures", 10); // Safe due to method contracts
2016-07-13 11:47:57 +10:00
+ for (int i = 0; i < textures.size(); i++) {
2021-11-22 09:00:00 +11:00
+ if (textures.get(i) instanceof NBTTagCompound && !((NBTTagCompound) textures.get(i)).contains("Signature", 8) && ((NBTTagCompound) textures.get(i)).getString("Value").trim().isEmpty()) {
+ nbttagcompound.remove("SkullOwner");
+ break;
2016-07-13 11:47:57 +10:00
+ }
+ }
+ // CraftBukkit end
}
2021-06-11 15:00:00 +10:00
}