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
@@ -22,11 +22,11 @@ package appeng.container.slot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.Items;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.world.World;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.oredict.OreDictionary;
import appeng.api.AEApi;
@@ -59,7 +59,7 @@ public class SlotRestrictedInput extends AppEngSlot
private boolean allowEdit = true;
private int stackLimit = -1;
public SlotRestrictedInput( final PlacableItemType valid, final IInventory i, final int slotIndex, final int x, final int y, final InventoryPlayer p )
public SlotRestrictedInput( final PlacableItemType valid, final IItemHandler i, final int slotIndex, final int x, final int y, final InventoryPlayer p )
{
super( i, slotIndex, x, y );
this.which = valid;
@@ -106,12 +106,13 @@ public class SlotRestrictedInput extends AppEngSlot
{
return false;
}
if( i.getItem() == Items.AIR )
{
return false;
}
if( !this.inventory.isItemValidForSlot( this.getSlotIndex(), i ) )
if( !super.isItemValid( i ) )
{
return false;
}