java.lang.Object
com.portingdeadmods.portingdeadlibs.api.gui.menus.slots.AbstractSlot
com.portingdeadmods.portingdeadlibs.api.gui.menus.slots.ReferenceSlot<T>
Type Parameters:
T - The type of reference (ItemStack or FluidStack)
Direct Known Subclasses:
FluidReferenceSlot, ItemReferenceSlot

public abstract class ReferenceSlot<T> extends AbstractSlot
A generic base reference slot that doesn't actually consume items when set. Used for pattern/filter/setting slots.
  • Field Details

  • Constructor Details

  • Method Details

    • getEmptyReference

      protected abstract T getEmptyReference()
      Returns an empty reference of type T
    • setReference

      public abstract boolean setReference(net.minecraft.world.item.ItemStack stack)
      Called when a player clicks on this slot with an item
      Parameters:
      stack - The stack the player is holding
      Returns:
      true if the reference was set, false otherwise
    • setReferenceDirectly

      public boolean setReferenceDirectly(T reference)
      Sets the reference directly
      Parameters:
      reference - The reference to set
      Returns:
      true if the reference was set, false otherwise
    • copyReference

      protected abstract T copyReference(T reference)
      Creates a copy of the reference
    • areReferencesEqual

      protected abstract boolean areReferencesEqual(T reference1, T reference2)
      Checks if two references are equal
    • isReferenceEmpty

      protected abstract boolean isReferenceEmpty(T reference)
      Checks if a reference is empty
    • clearReference

      public void clearReference()
      Clears the current reference
    • getReference

      public T getReference()
      Gets the current reference
    • handleSpecialClick

      public boolean handleSpecialClick(net.minecraft.world.entity.player.Player player, net.minecraft.world.inventory.ClickType clickType, net.minecraft.world.inventory.ClickAction clickAction)
      Override this to handle clicking with a fluid container
      Parameters:
      player - The player clicking
      clickType - The type of click
      clickAction - The click action
      Returns:
      true if the click was handled