Upstream Paper
This commit is contained in:
@@ -42,6 +42,7 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
|
||||
|
||||
if (this.f() || (i & 1 << j) != 0) {
|
||||
NBTTagCompound nbttagcompound = tileentity.aa_();
|
||||
if (tileentity instanceof TileEntitySkull) { TileEntitySkull.sanitizeTileEntityUUID(nbttagcompound); } // Paper
|
||||
|
||||
this.e.add(nbttagcompound);
|
||||
}
|
||||
|
||||
@@ -143,10 +143,38 @@ public class TileEntitySkull extends TileEntity /*implements ITickable*/ { // Pa
|
||||
public GameProfile getGameProfile() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
// Paper start
|
||||
static NBTTagCompound sanitizeTileEntityUUID(NBTTagCompound cmp) {
|
||||
NBTTagCompound owner = cmp.getCompound("Owner");
|
||||
if (!owner.isEmpty()) {
|
||||
sanitizeUUID(owner);
|
||||
}
|
||||
return cmp;
|
||||
}
|
||||
|
||||
static void sanitizeUUID(NBTTagCompound owner) {
|
||||
NBTTagCompound properties = owner.getCompound("Properties");
|
||||
NBTTagList list = null;
|
||||
if (!properties.isEmpty()) {
|
||||
list = properties.getList("textures", 10);
|
||||
}
|
||||
|
||||
if (list != null && !list.isEmpty()) {
|
||||
String textures = ((NBTTagCompound)list.get(0)).getString("Value");
|
||||
if (textures != null && textures.length() > 3) {
|
||||
String uuid = UUID.nameUUIDFromBytes(textures.getBytes()).toString();
|
||||
owner.setString("Id", uuid);
|
||||
return;
|
||||
}
|
||||
}
|
||||
owner.setString("Id", UUID.randomUUID().toString());
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@Nullable
|
||||
public PacketPlayOutTileEntityData getUpdatePacket() {
|
||||
return new PacketPlayOutTileEntityData(this.position, 4, this.aa_());
|
||||
return new PacketPlayOutTileEntityData(this.position, 4, sanitizeTileEntityUUID(this.aa_())); // Paper
|
||||
}
|
||||
|
||||
public NBTTagCompound aa_() {
|
||||
|
||||
Reference in New Issue
Block a user