Search in sources :

Example 31 with IItemHandlerModifiable

use of net.minecraftforge.items.IItemHandlerModifiable in project MinecraftForge by MinecraftForge.

the class CombinedInvWrapper method getSlotLimit.

@Override
public int getSlotLimit(int slot) {
    int index = getIndexForSlot(slot);
    IItemHandlerModifiable handler = getHandlerFromIndex(index);
    int localSlot = getSlotFromIndex(slot, index);
    return handler.getSlotLimit(localSlot);
}
Also used : IItemHandlerModifiable(net.minecraftforge.items.IItemHandlerModifiable)

Example 32 with IItemHandlerModifiable

use of net.minecraftforge.items.IItemHandlerModifiable in project MinecraftForge by MinecraftForge.

the class CombinedInvWrapper method insertItem.

@Override
@Nonnull
public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) {
    int index = getIndexForSlot(slot);
    IItemHandlerModifiable handler = getHandlerFromIndex(index);
    slot = getSlotFromIndex(slot, index);
    return handler.insertItem(slot, stack, simulate);
}
Also used : IItemHandlerModifiable(net.minecraftforge.items.IItemHandlerModifiable) Nonnull(javax.annotation.Nonnull)

Example 33 with IItemHandlerModifiable

use of net.minecraftforge.items.IItemHandlerModifiable in project MinecraftForge by MinecraftForge.

the class CombinedInvWrapper method isItemValid.

@Override
public boolean isItemValid(int slot, @Nonnull ItemStack stack) {
    int index = getIndexForSlot(slot);
    IItemHandlerModifiable handler = getHandlerFromIndex(index);
    int localSlot = getSlotFromIndex(slot, index);
    return handler.isItemValid(localSlot, stack);
}
Also used : IItemHandlerModifiable(net.minecraftforge.items.IItemHandlerModifiable)

Example 34 with IItemHandlerModifiable

use of net.minecraftforge.items.IItemHandlerModifiable in project MinecraftForge by MinecraftForge.

the class CombinedInvWrapper method setStackInSlot.

@Override
public void setStackInSlot(int slot, @Nonnull ItemStack stack) {
    int index = getIndexForSlot(slot);
    IItemHandlerModifiable handler = getHandlerFromIndex(index);
    slot = getSlotFromIndex(slot, index);
    handler.setStackInSlot(slot, stack);
}
Also used : IItemHandlerModifiable(net.minecraftforge.items.IItemHandlerModifiable)

Example 35 with IItemHandlerModifiable

use of net.minecraftforge.items.IItemHandlerModifiable in project MinecraftForge by MinecraftForge.

the class CombinedInvWrapper method extractItem.

@Override
@Nonnull
public ItemStack extractItem(int slot, int amount, boolean simulate) {
    int index = getIndexForSlot(slot);
    IItemHandlerModifiable handler = getHandlerFromIndex(index);
    slot = getSlotFromIndex(slot, index);
    return handler.extractItem(slot, amount, simulate);
}
Also used : IItemHandlerModifiable(net.minecraftforge.items.IItemHandlerModifiable) Nonnull(javax.annotation.Nonnull)

Aggregations

IItemHandlerModifiable (net.minecraftforge.items.IItemHandlerModifiable)39 ItemStack (net.minecraft.item.ItemStack)15 IItemHandler (net.minecraftforge.items.IItemHandler)9 IElectricItem (gregtech.api.capability.IElectricItem)6 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)5 NBTTagList (net.minecraft.nbt.NBTTagList)5 Nonnull (javax.annotation.Nonnull)4 TileEntity (net.minecraft.tileentity.TileEntity)4 INBTSerializable (net.minecraftforge.common.util.INBTSerializable)4 IFluidHandler (net.minecraftforge.fluids.capability.IFluidHandler)3 EntityPlayer (net.minecraft.entity.player.EntityPlayer)2 NBTTagInt (net.minecraft.nbt.NBTTagInt)2 EnumFacing (net.minecraft.util.EnumFacing)2 World (net.minecraft.world.World)2 EnumPipePart (buildcraft.api.core.EnumPipePart)1 IItemHandlerFiltered (buildcraft.api.inventory.IItemHandlerFiltered)1 IPhantomSlot (buildcraft.lib.gui.slot.IPhantomSlot)1 SlotPhantom (buildcraft.lib.gui.slot.SlotPhantom)1 IItemHandlerAdv (buildcraft.lib.tile.item.IItemHandlerAdv)1 ImmutableCollection (com.google.common.collect.ImmutableCollection)1