Interface InputSlot.ActionHandler

Enclosing class:
InputSlot

public static interface InputSlot.ActionHandler
Represents the action that should happen when this input slot is interacted with
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    When called should perform the action that should happen when this input slot is clicked
    void
    onCurrentItemChanged(GUISession guiSession, org.bukkit.inventory.ItemStack newItem)
    Method called when the item currently in this InputSlot changes.
    void
    When called should perform the action that should happen when this input slot's item is picked up
    void
    When called should perform the action that should happen when this input slot has an item placed into it
    boolean
    shouldAllowAutoInsert(org.bukkit.entity.Player viewer, GUISession session)
    Whether or not viewers can use Minecraft's auto-insert (Shift click) feature with this slot.
  • Method Details

    • shouldAllowAutoInsert

      boolean shouldAllowAutoInsert(org.bukkit.entity.Player viewer, GUISession session)
      Whether or not viewers can use Minecraft's auto-insert (Shift click) feature with this slot. If they can then shift-clicking will be able to target this slot. Shift click events won't be passed directly to the GUIElement though, they are instead turned into pickup and place events and those are passed to GUIElements as appropriate.
      Parameters:
      viewer - The viewer trying to auto insert into the slot
      session - The GUISession trying to auto insert into the slot
      Returns:
      True if viewer may auto insert into slot, False if not
    • onClick

      void onClick(GUIMiscClickEvent event)
      When called should perform the action that should happen when this input slot is clicked
      Parameters:
      event - The ClickEvent that caused this to be called
    • onPickupItem

      void onPickupItem(GUIPickupItemEvent event)
      When called should perform the action that should happen when this input slot's item is picked up
      Parameters:
      event - The PickupItemEvent that caused this to be called
    • onPlaceItem

      void onPlaceItem(GUIPlaceItemEvent event)
      When called should perform the action that should happen when this input slot has an item placed into it
      Parameters:
      event - The PlaceItemEvent that caused this to be called
    • onCurrentItemChanged

      void onCurrentItemChanged(GUISession guiSession, org.bukkit.inventory.ItemStack newItem)
      Method called when the item currently in this InputSlot changes.
      Parameters:
      guiSession - The GUI session that this has happened for
      newItem - The item now currently inside this InputSlot