Use IItemHandler instead of IInventory internally (#2971)
* Use IItemHandler instead of IInventory internally
This commit is contained in:
@@ -19,34 +19,38 @@
|
||||
package appeng.container.slot;
|
||||
|
||||
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.util.inv.WrapperInvItemHandler;
|
||||
|
||||
|
||||
public class SlotCraftingMatrix extends AppEngSlot
|
||||
{
|
||||
private final AEBaseContainer c;
|
||||
private final IInventory wrappedInventory;
|
||||
|
||||
private final Container c;
|
||||
|
||||
public SlotCraftingMatrix( final Container c, final IInventory par1iInventory, final int par2, final int par3, final int par4 )
|
||||
public SlotCraftingMatrix( final AEBaseContainer c, final IItemHandler par1iInventory, final int par2, final int par3, final int par4 )
|
||||
{
|
||||
super( par1iInventory, par2, par3, par4 );
|
||||
this.c = c;
|
||||
this.wrappedInventory = new WrapperInvItemHandler( par1iInventory );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearStack()
|
||||
{
|
||||
super.clearStack();
|
||||
this.c.onCraftMatrixChanged( this.inventory );
|
||||
this.c.onCraftMatrixChanged( this.wrappedInventory );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putStack( final ItemStack par1ItemStack )
|
||||
{
|
||||
super.putStack( par1ItemStack );
|
||||
this.c.onCraftMatrixChanged( this.inventory );
|
||||
this.c.onCraftMatrixChanged( this.wrappedInventory );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -59,7 +63,7 @@ public class SlotCraftingMatrix extends AppEngSlot
|
||||
public ItemStack decrStackSize( final int par1 )
|
||||
{
|
||||
final ItemStack is = super.decrStackSize( par1 );
|
||||
this.c.onCraftMatrixChanged( this.inventory );
|
||||
this.c.onCraftMatrixChanged( this.wrappedInventory );
|
||||
return is;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user