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 TypeMethodDescriptionvoidonClick(GUIMiscClickEvent event) When called should perform the action that should happen when this input slot is clickedvoidonCurrentItemChanged(GUISession guiSession, org.bukkit.inventory.ItemStack newItem) Method called when the item currently in this InputSlot changes.voidonPickupItem(GUIPickupItemEvent event) When called should perform the action that should happen when this input slot's item is picked upvoidonPlaceItem(GUIPlaceItemEvent event) When called should perform the action that should happen when this input slot has an item placed into itbooleanshouldAllowAutoInsert(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
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 slotsession- The GUISession trying to auto insert into the slot- Returns:
- True if viewer may auto insert into slot, False if not
-
onClick
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
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
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
Method called when the item currently in this InputSlot changes.- Parameters:
guiSession- The GUI session that this has happened fornewItem- The item now currently inside this InputSlot
-