Class ItemHandlerCopySlot


public class ItemHandlerCopySlot extends StackCopySlot
Slot class that can be used with immutable IItemHandlers like ComponentItemHandler.
  • Field Details

  • Constructor Details

    • ItemHandlerCopySlot

      public ItemHandlerCopySlot(IItemHandler itemHandler, int index, int xPosition, int yPosition)
    • ItemHandlerCopySlot

      public ItemHandlerCopySlot(SlotItemHandler slotItemHandler)
  • Method Details

    • mayPlace

      public boolean mayPlace(ItemStack stack)
      Overrides:
      mayPlace in class Slot
    • getStackCopy

      protected ItemStack getStackCopy()
      Description copied from class: StackCopySlot
      Gets the itemstack from the storage.
      Specified by:
      getStackCopy in class StackCopySlot
      Returns:
      the stack in this slot
    • setStackCopy

      protected void setStackCopy(ItemStack stack)
      Description copied from class: StackCopySlot
      Sets the itemstack from the storage.
      Specified by:
      setStackCopy in class StackCopySlot
      Parameters:
      stack - the stack to put into this slot
    • onQuickCraft

      public void onQuickCraft(ItemStack oldStackIn, ItemStack newStackIn)
      Overrides:
      onQuickCraft in class Slot
    • getMaxStackSize

      public int getMaxStackSize()
      Overrides:
      getMaxStackSize in class Slot
    • getMaxStackSize

      public int getMaxStackSize(ItemStack stack)
      Overrides:
      getMaxStackSize in class Slot
    • mayPickup

      public boolean mayPickup(Player playerIn)
      Overrides:
      mayPickup in class Slot
    • isSameInventory

      public boolean isSameInventory(Slot other)
      Description copied from class: Slot
      Checks if the other slot is in the same inventory, by comparing the inventory reference.
      Overrides:
      isSameInventory in class Slot
      Parameters:
      other -
      Returns:
      true if the other slot is in the same inventory
    • getItemHandler

      public IItemHandler getItemHandler()