Add a converter method

This commit is contained in:
zontreck 2024-05-23 10:13:51 -07:00
parent d4b7a12187
commit cc151e9109
2 changed files with 9 additions and 1 deletions

View file

@ -25,6 +25,14 @@ class NbtUUID {
/// Returns the Least Significant Bits (LSB) long value of the UUID.
int getLeastSignificantBits() => LSB;
UUID toUUID() {
ByteLayer layer = ByteLayer();
layer.writeUnsignedLong(MSB);
layer.writeUnsignedLong(LSB);
return UUID(layer.readBytes(16));
}
}
/*