Package net.minecraftforge.items
Class VanillaHopperItemHandler
- java.lang.Object
-
- net.minecraftforge.items.wrapper.InvWrapper
-
- net.minecraftforge.items.VanillaHopperItemHandler
-
- All Implemented Interfaces:
IItemHandler,IItemHandlerModifiable
public class VanillaHopperItemHandler extends InvWrapper
-
-
Field Summary
Fields Modifier and Type Field Description private HopperTileEntityhopper
-
Constructor Summary
Constructors Constructor Description VanillaHopperItemHandler(HopperTileEntity hopper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ItemStackinsertItem(int slot, ItemStack stack, boolean simulate)Inserts an ItemStack into the given slot and return the remainder.-
Methods inherited from class net.minecraftforge.items.wrapper.InvWrapper
equals, extractItem, getInv, getSlotLimit, getSlots, getStackInSlot, hashCode, isItemValid, setStackInSlot
-
-
-
-
Field Detail
-
hopper
private final HopperTileEntity hopper
-
-
Constructor Detail
-
VanillaHopperItemHandler
public VanillaHopperItemHandler(HopperTileEntity hopper)
-
-
Method Detail
-
insertItem
@Nonnull public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate)
Description copied from interface:IItemHandlerInserts an ItemStack into the given slot and return the remainder. The ItemStack should not be modified in this function!
Note: This behaviour is subtly different fromIFluidHandler#fill(FluidStack, boolean)- Specified by:
insertItemin interfaceIItemHandler- Overrides:
insertItemin classInvWrapper- Parameters:
slot- Slot to insert into.stack- ItemStack to insert. This must not be modified by the item handler.simulate- If true, the insertion is only simulated- Returns:
- The remaining ItemStack that was not inserted (if the entire stack is accepted, then return an empty ItemStack). May be the same as the input ItemStack if unchanged, otherwise a new ItemStack. The returned ItemStack can be safely modified after.
-
-