1.5 -> 1.6 migration: store RS version in storage disks. #1816

This commit is contained in:
raoulvdberge
2018-06-14 22:17:31 +02:00
parent 2daed84c03
commit 8a93ff122c
2 changed files with 6 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ package com.raoulvdberge.refinedstorage.apiimpl.storage.disk;
import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap; import com.google.common.collect.Multimap;
import com.raoulvdberge.refinedstorage.RS;
import com.raoulvdberge.refinedstorage.api.storage.AccessType; import com.raoulvdberge.refinedstorage.api.storage.AccessType;
import com.raoulvdberge.refinedstorage.api.storage.disk.IStorageDisk; import com.raoulvdberge.refinedstorage.api.storage.disk.IStorageDisk;
import com.raoulvdberge.refinedstorage.api.storage.disk.IStorageDiskContainerContext; import com.raoulvdberge.refinedstorage.api.storage.disk.IStorageDiskContainerContext;
@@ -19,6 +20,7 @@ import javax.annotation.Nullable;
import java.util.Collection; import java.util.Collection;
public class StorageDiskFluid implements IStorageDisk<FluidStack> { public class StorageDiskFluid implements IStorageDisk<FluidStack> {
static final String NBT_VERSION = "Version";
static final String NBT_CAPACITY = "Capacity"; static final String NBT_CAPACITY = "Capacity";
static final String NBT_FLUIDS = "Fluids"; static final String NBT_FLUIDS = "Fluids";
@@ -49,6 +51,7 @@ public class StorageDiskFluid implements IStorageDisk<FluidStack> {
list.appendTag(stack.writeToNBT(new NBTTagCompound())); list.appendTag(stack.writeToNBT(new NBTTagCompound()));
} }
tag.setString(NBT_VERSION, RS.VERSION);
tag.setTag(NBT_FLUIDS, list); tag.setTag(NBT_FLUIDS, list);
tag.setInteger(NBT_CAPACITY, capacity); tag.setInteger(NBT_CAPACITY, capacity);

View File

@@ -2,6 +2,7 @@ package com.raoulvdberge.refinedstorage.apiimpl.storage.disk;
import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap; import com.google.common.collect.Multimap;
import com.raoulvdberge.refinedstorage.RS;
import com.raoulvdberge.refinedstorage.api.storage.AccessType; import com.raoulvdberge.refinedstorage.api.storage.AccessType;
import com.raoulvdberge.refinedstorage.api.storage.disk.IStorageDisk; import com.raoulvdberge.refinedstorage.api.storage.disk.IStorageDisk;
import com.raoulvdberge.refinedstorage.api.storage.disk.IStorageDiskContainerContext; import com.raoulvdberge.refinedstorage.api.storage.disk.IStorageDiskContainerContext;
@@ -22,6 +23,7 @@ import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
public class StorageDiskItem implements IStorageDisk<ItemStack> { public class StorageDiskItem implements IStorageDisk<ItemStack> {
static final String NBT_VERSION = "Version";
static final String NBT_CAPACITY = "Capacity"; static final String NBT_CAPACITY = "Capacity";
static final String NBT_ITEMS = "Items"; static final String NBT_ITEMS = "Items";
@@ -79,6 +81,7 @@ public class StorageDiskItem implements IStorageDisk<ItemStack> {
list.appendTag(itemTag); list.appendTag(itemTag);
} }
tag.setString(NBT_VERSION, RS.VERSION);
tag.setTag(NBT_ITEMS, list); tag.setTag(NBT_ITEMS, list);
tag.setInteger(NBT_CAPACITY, capacity); tag.setInteger(NBT_CAPACITY, capacity);