Migrations
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
package appeng.me.storage;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
@@ -47,7 +47,7 @@ public abstract class AbstractCellInventory<T extends IAEStack<T>> implements IC
|
||||
protected static final String ITEM_PRE_FORMATTED_FUZZY = "FP";
|
||||
private static final String[] ITEM_SLOT_KEYS = new String[MAX_ITEM_TYPES];
|
||||
private static final String[] ITEM_SLOT_COUNT_KEYS = new String[MAX_ITEM_TYPES];
|
||||
private final CompoundNBT tagCompound;
|
||||
private final CompoundTag tagCompound;
|
||||
protected final ISaveProvider container;
|
||||
private int maxItemTypes = MAX_ITEM_TYPES;
|
||||
private short storedItems = 0;
|
||||
@@ -107,7 +107,7 @@ public abstract class AbstractCellInventory<T extends IAEStack<T>> implements IC
|
||||
for (final T v : this.cellItems) {
|
||||
itemCount += v.getStackSize();
|
||||
|
||||
final CompoundNBT g = new CompoundNBT();
|
||||
final CompoundTag g = new CompoundTag();
|
||||
v.writeToNBT(g);
|
||||
this.tagCompound.put(ITEM_SLOT_KEYS[x], g);
|
||||
this.tagCompound.putInt(ITEM_SLOT_COUNT_KEYS[x], (int) v.getStackSize());
|
||||
@@ -168,7 +168,7 @@ public abstract class AbstractCellInventory<T extends IAEStack<T>> implements IC
|
||||
boolean needsUpdate = false;
|
||||
|
||||
for (int slot = 0; slot < types; slot++) {
|
||||
CompoundNBT compoundTag = this.tagCompound.getCompound(ITEM_SLOT_KEYS[slot]);
|
||||
CompoundTag compoundTag = this.tagCompound.getCompound(ITEM_SLOT_KEYS[slot]);
|
||||
int stackSize = this.tagCompound.getInt(ITEM_SLOT_COUNT_KEYS[slot]);
|
||||
needsUpdate |= !this.loadCellItem(compoundTag, stackSize);
|
||||
}
|
||||
@@ -185,7 +185,7 @@ public abstract class AbstractCellInventory<T extends IAEStack<T>> implements IC
|
||||
* @param stackSize
|
||||
* @return true when successfully loaded
|
||||
*/
|
||||
protected abstract boolean loadCellItem(CompoundNBT compoundTag, int stackSize);
|
||||
protected abstract boolean loadCellItem(CompoundTag compoundTag, int stackSize);
|
||||
|
||||
@Override
|
||||
public IItemList<T> getAvailableItems(final IItemList<T> out) {
|
||||
|
||||
@@ -3,7 +3,7 @@ package appeng.me.storage;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.exceptions.AppEngException;
|
||||
@@ -208,7 +208,7 @@ public class BasicCellInventory<T extends IAEStack<T>> extends AbstractCellInven
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean loadCellItem(CompoundNBT compoundTag, int stackSize) {
|
||||
protected boolean loadCellItem(CompoundTag compoundTag, int stackSize) {
|
||||
// Now load the item stack
|
||||
final T t;
|
||||
try {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package appeng.me.storage;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
@@ -122,7 +122,7 @@ public class BasicCellInventoryHandler<T extends IAEStack<T>> extends MEInventor
|
||||
return this.getWhitelist();
|
||||
}
|
||||
|
||||
CompoundNBT openNbtData() {
|
||||
CompoundTag openNbtData() {
|
||||
return this.getCellInv().getItemStack().getOrCreateTag();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user