Fix 1.15->1.16 item attribute uuid (#3793)

This commit is contained in:
AJ Ferguson 2024-04-19 04:09:17 -04:00 committed by GitHub
parent bfde4b953c
commit 128e191132
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -203,8 +203,10 @@ public class InventoryPackets extends ItemRewriter<ClientboundPackets1_15, Serve
NumberTag leastTag = attribute.getNumberTag("UUIDLeast");
NumberTag mostTag = attribute.getNumberTag("UUIDMost");
if (leastTag != null && mostTag != null) {
int[] uuidIntArray = UUIDUtil.toIntArray(leastTag.asLong(), mostTag.asLong());
int[] uuidIntArray = UUIDUtil.toIntArray(mostTag.asLong(), leastTag.asLong());
attribute.put("UUID", new IntArrayTag(uuidIntArray));
attribute.remove("UUIDLeast");
attribute.remove("UUIDMost");
}
}
}
@ -223,6 +225,7 @@ public class InventoryPackets extends ItemRewriter<ClientboundPackets1_15, Serve
UUID uuid = UUIDUtil.fromIntArray(uuidTag.getValue());
attribute.putLong("UUIDLeast", uuid.getLeastSignificantBits());
attribute.putLong("UUIDMost", uuid.getMostSignificantBits());
attribute.remove("UUID");
}
}
}