From 8a93ff122c604a1b5baa7e7b54ef47a0bbeef592 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Thu, 14 Jun 2018 22:17:31 +0200 Subject: [PATCH] 1.5 -> 1.6 migration: store RS version in storage disks. #1816 --- .../refinedstorage/apiimpl/storage/disk/StorageDiskFluid.java | 3 +++ .../refinedstorage/apiimpl/storage/disk/StorageDiskItem.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/disk/StorageDiskFluid.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/disk/StorageDiskFluid.java index ac34f4645..a7f0b097b 100644 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/disk/StorageDiskFluid.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/disk/StorageDiskFluid.java @@ -2,6 +2,7 @@ package com.raoulvdberge.refinedstorage.apiimpl.storage.disk; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Multimap; +import com.raoulvdberge.refinedstorage.RS; import com.raoulvdberge.refinedstorage.api.storage.AccessType; import com.raoulvdberge.refinedstorage.api.storage.disk.IStorageDisk; import com.raoulvdberge.refinedstorage.api.storage.disk.IStorageDiskContainerContext; @@ -19,6 +20,7 @@ import javax.annotation.Nullable; import java.util.Collection; public class StorageDiskFluid implements IStorageDisk { + static final String NBT_VERSION = "Version"; static final String NBT_CAPACITY = "Capacity"; static final String NBT_FLUIDS = "Fluids"; @@ -49,6 +51,7 @@ public class StorageDiskFluid implements IStorageDisk { list.appendTag(stack.writeToNBT(new NBTTagCompound())); } + tag.setString(NBT_VERSION, RS.VERSION); tag.setTag(NBT_FLUIDS, list); tag.setInteger(NBT_CAPACITY, capacity); diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/disk/StorageDiskItem.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/disk/StorageDiskItem.java index 7ffabb03e..b81199ddf 100644 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/disk/StorageDiskItem.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/storage/disk/StorageDiskItem.java @@ -2,6 +2,7 @@ package com.raoulvdberge.refinedstorage.apiimpl.storage.disk; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Multimap; +import com.raoulvdberge.refinedstorage.RS; import com.raoulvdberge.refinedstorage.api.storage.AccessType; import com.raoulvdberge.refinedstorage.api.storage.disk.IStorageDisk; import com.raoulvdberge.refinedstorage.api.storage.disk.IStorageDiskContainerContext; @@ -22,6 +23,7 @@ import java.util.ArrayList; import java.util.Collection; public class StorageDiskItem implements IStorageDisk { + static final String NBT_VERSION = "Version"; static final String NBT_CAPACITY = "Capacity"; static final String NBT_ITEMS = "Items"; @@ -79,6 +81,7 @@ public class StorageDiskItem implements IStorageDisk { list.appendTag(itemTag); } + tag.setString(NBT_VERSION, RS.VERSION); tag.setTag(NBT_ITEMS, list); tag.setInteger(NBT_CAPACITY, capacity);