Use IItemHandler instead of IInventory internally (#2971)

* Use IItemHandler instead of IInventory internally
This commit is contained in:
fscan
2017-07-28 22:04:32 +02:00
committed by yueh
parent c077840988
commit 52d28fabe3
156 changed files with 2410 additions and 4604 deletions
@@ -21,11 +21,11 @@ package appeng.me.storage;
import java.util.HashSet;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.oredict.OreDictionary;
import appeng.api.AEApi;
@@ -534,13 +534,13 @@ public class CellInventory implements ICellInventory
}
@Override
public IInventory getConfigInventory()
public IItemHandler getConfigInventory()
{
return this.cellType.getConfigInventory( this.i );
}
@Override
public IInventory getUpgradesInventory()
public IItemHandler getUpgradesInventory()
{
return this.cellType.getUpgradesInventory( this.i );
}
@@ -19,9 +19,9 @@
package appeng.me.storage;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.items.IItemHandler;
import appeng.api.AEApi;
import appeng.api.config.FuzzyMode;
@@ -52,14 +52,14 @@ public class CellInventoryHandler extends MEInventoryHandler<IAEItemStack> imple
{
final IItemList<IAEItemStack> priorityList = AEApi.instance().storage().createItemList();
final IInventory upgrades = ci.getUpgradesInventory();
final IInventory config = ci.getConfigInventory();
final IItemHandler upgrades = ci.getUpgradesInventory();
final IItemHandler config = ci.getConfigInventory();
final FuzzyMode fzMode = ci.getFuzzyMode();
boolean hasInverter = false;
boolean hasFuzzy = false;
for( int x = 0; x < upgrades.getSizeInventory(); x++ )
for( int x = 0; x < upgrades.getSlots(); x++ )
{
final ItemStack is = upgrades.getStackInSlot( x );
if( !is.isEmpty() && is.getItem() instanceof IUpgradeModule )
@@ -81,7 +81,7 @@ public class CellInventoryHandler extends MEInventoryHandler<IAEItemStack> imple
}
}
for( int x = 0; x < config.getSizeInventory(); x++ )
for( int x = 0; x < config.getSlots(); x++ )
{
final ItemStack is = config.getStackInSlot( x );
if( !is.isEmpty() )