Fixed potentially missing blob handle in hard drive data export to item stack.

This commit is contained in:
Florian Nücke
2021-01-08 21:09:04 +01:00
parent 4f93417bd2
commit ca91f45306

View File

@@ -83,6 +83,9 @@ public abstract class AbstractHardDriveVMDevice<T extends BlockDevice> extends I
@Override
public void exportToItemStack(final CompoundNBT nbt) {
if (blobHandle == null && data != null) {
getSerializationStream(data).ifPresent(stream -> blobHandle = BlobStorage.validateHandle(blobHandle));
}
if (blobHandle != null) {
nbt.putUniqueId(BLOB_HANDLE_NBT_TAG_NAME, blobHandle);
}