Class SingleItemStackHandler

java.lang.Object
net.minecraft.world.inventory.Slot
com.pixelmonmod.pixelmon.client.gui.machines.slots.SingleItemStackHandler

public class SingleItemStackHandler extends net.minecraft.world.inventory.Slot
  • Field Summary

    Fields inherited from class net.minecraft.world.inventory.Slot

    container, x, y
  • Constructor Summary

    Constructors
    Constructor
    Description
    SingleItemStackHandler(net.minecraftforge.items.IItemHandler itemHandler, int index, int xPosition, int yPosition)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.item.ItemStack
    Helper fnct to get the stack in the slot.
    net.minecraftforge.items.IItemHandler
     
    int
    Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case of armor slots)
    int
    getMaxStackSize(net.minecraft.world.item.ItemStack stack)
     
    boolean
    isSameInventory(net.minecraft.world.inventory.Slot other)
     
    boolean
    mayPickup(net.minecraft.world.entity.player.Player playerIn)
    Return whether this slot's stack can be taken from this slot.
    boolean
    mayPlace(net.minecraft.world.item.ItemStack stack)
    Check if the stack is allowed to be placed in this slot, used for armor slots as well as furnace fuel.
    void
    onQuickCraft(net.minecraft.world.item.ItemStack p_75220_1_, net.minecraft.world.item.ItemStack p_75220_2_)
    if par2 has more items than par1, onCrafting(item,countIncrease) is called
    net.minecraft.world.item.ItemStack
    remove(int amount)
    Decrease the size of the stack in slot (first int arg) by the amount of the second int arg.
    void
    set(net.minecraft.world.item.ItemStack stack)
    Helper method to put a stack in the slot.

    Methods inherited from class net.minecraft.world.inventory.Slot

    allowModification, checkTakeAchievements, getContainerSlot, getNoItemIcon, getSlotIndex, hasItem, isActive, isHighlightable, onQuickCraft, onSwapCraft, onTake, safeInsert, safeInsert, safeTake, setBackground, setByPlayer, setByPlayer, setChanged, tryRemove

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SingleItemStackHandler

      public SingleItemStackHandler(net.minecraftforge.items.IItemHandler itemHandler, int index, int xPosition, int yPosition)
  • Method Details

    • mayPlace

      public boolean mayPlace(@Nonnull net.minecraft.world.item.ItemStack stack)
      Check if the stack is allowed to be placed in this slot, used for armor slots as well as furnace fuel.
      Overrides:
      mayPlace in class net.minecraft.world.inventory.Slot
    • getItem

      @Nonnull public net.minecraft.world.item.ItemStack getItem()
      Helper fnct to get the stack in the slot.
      Overrides:
      getItem in class net.minecraft.world.inventory.Slot
    • set

      public void set(@Nonnull net.minecraft.world.item.ItemStack stack)
      Helper method to put a stack in the slot.
      Overrides:
      set in class net.minecraft.world.inventory.Slot
    • onQuickCraft

      public void onQuickCraft(@Nonnull net.minecraft.world.item.ItemStack p_75220_1_, @Nonnull net.minecraft.world.item.ItemStack p_75220_2_)
      if par2 has more items than par1, onCrafting(item,countIncrease) is called
      Overrides:
      onQuickCraft in class net.minecraft.world.inventory.Slot
    • getMaxStackSize

      public int getMaxStackSize()
      Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case of armor slots)
      Overrides:
      getMaxStackSize in class net.minecraft.world.inventory.Slot
    • getMaxStackSize

      public int getMaxStackSize(@Nonnull net.minecraft.world.item.ItemStack stack)
      Overrides:
      getMaxStackSize in class net.minecraft.world.inventory.Slot
    • mayPickup

      public boolean mayPickup(net.minecraft.world.entity.player.Player playerIn)
      Return whether this slot's stack can be taken from this slot.
      Overrides:
      mayPickup in class net.minecraft.world.inventory.Slot
    • remove

      @Nonnull public net.minecraft.world.item.ItemStack remove(int amount)
      Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new stack.
      Overrides:
      remove in class net.minecraft.world.inventory.Slot
    • getItemHandler

      public net.minecraftforge.items.IItemHandler getItemHandler()
    • isSameInventory

      public boolean isSameInventory(net.minecraft.world.inventory.Slot other)
      Overrides:
      isSameInventory in class net.minecraft.world.inventory.Slot