Class PlayerMainInvWrapper

All Implemented Interfaces:
IItemHandler, IItemHandlerModifiable

public class PlayerMainInvWrapper extends RangedWrapper
Exposes the player inventory WITHOUT the armor inventory as IItemHandler. Also takes core of inserting/extracting having the same logic as picking up items.
  • Field Details

  • Constructor Details

  • Method Details

    • insertItem

      @Nonnull public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate)
      Description copied from interface: IItemHandler

      Inserts 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 from IFluidHandler#fill(FluidStack, boolean)
      Specified by:
      insertItem in interface IItemHandler
      insertItem in class RangedWrapper
      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
      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.
    • getInventoryPlayer

      public PlayerInventory getInventoryPlayer()