Class SlotItemHandler

java.lang.Object
net.minecraft.world.inventory.Slot
net.neoforged.neoforge.items.SlotItemHandler

@Deprecated(since="1.21.9", forRemoval=true) public class SlotItemHandler extends Slot
Deprecated, for removal: This API element is subject to removal in a future version.
Use ResourceHandlerSlot instead.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final Container
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected final int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    private final IItemHandler
    Deprecated, for removal: This API element is subject to removal in a future version.
     

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

    container, x, y
  • Constructor Summary

    Constructors
    Constructor
    Description
    SlotItemHandler(IItemHandler itemHandler, int index, int xPosition, int yPosition)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks if the other slot is in the same inventory, by comparing the inventory reference.
    boolean
    mayPickup(Player playerIn)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Return whether this slot's stack can be taken from this slot.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Check if the stack is allowed to be placed in this slot, used for armor slots as well as furnace fuel.
    void
    onQuickCraft(ItemStack oldStackIn, ItemStack newStackIn)
    Deprecated, for removal: This API element is subject to removal in a future version.
    if par2 has more items than par1, onCrafting(item,countIncrease) is called
    remove(int amount)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Decrease the size of the stack in slot (first int arg) by the amount of the second int arg.
    void
    set(ItemStack stack)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Helper method to put a stack in the slot.

    Methods inherited from class java.lang.Object

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

    • EMPTY_INVENTORY

      private static final Container EMPTY_INVENTORY
      Deprecated, for removal: This API element is subject to removal in a future version.
    • itemHandler

      private final IItemHandler itemHandler
      Deprecated, for removal: This API element is subject to removal in a future version.
    • index

      protected final int index
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • SlotItemHandler

      public SlotItemHandler(IItemHandler itemHandler, int index, int xPosition, int yPosition)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • mayPlace

      public boolean mayPlace(ItemStack stack)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: Slot
      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 Slot
    • getItem

      public ItemStack getItem()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getItem in class Slot
    • set

      public void set(ItemStack stack)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: Slot
      Helper method to put a stack in the slot.
      Overrides:
      set in class Slot
    • initialize

      public void initialize(ItemStack stack)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • onQuickCraft

      public void onQuickCraft(ItemStack oldStackIn, ItemStack newStackIn)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: Slot
      if par2 has more items than par1, onCrafting(item,countIncrease) is called
      Overrides:
      onQuickCraft in class Slot
    • getMaxStackSize

      public int getMaxStackSize()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getMaxStackSize in class Slot
    • getMaxStackSize

      public int getMaxStackSize(ItemStack stack)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getMaxStackSize in class Slot
    • mayPickup

      public boolean mayPickup(Player playerIn)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: Slot
      Return whether this slot's stack can be taken from this slot.
      Overrides:
      mayPickup in class Slot
    • remove

      public ItemStack remove(int amount)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: Slot
      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 Slot
    • getItemHandler

      public IItemHandler getItemHandler()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • isSameInventory

      public boolean isSameInventory(Slot other)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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