public final class WindowClickLogic extends Object
Modifier and Type | Method and Description |
---|---|
static org.bukkit.event.inventory.InventoryAction |
getAction(org.bukkit.event.inventory.ClickType clickType,
org.bukkit.event.inventory.InventoryType.SlotType slot,
org.bukkit.inventory.ItemStack cursor,
org.bukkit.inventory.ItemStack slotItem)
Determine the InventoryAction to be performed for a window click based on the click type,
slot type, and items involved.
|
static org.bukkit.event.inventory.ClickType |
getClickType(int mode,
int button,
int slot)
Determine the ClickType of a window click message based on the raw mode, button, and slot
values if possible.
|
static boolean |
isPickupAction(org.bukkit.event.inventory.InventoryAction action)
Check if a given InventoryAction involves taking items from the slot.
|
static boolean |
isPlaceAction(org.bukkit.event.inventory.InventoryAction action)
Check if a given InventoryAction involves placing items into the slot.
|
public static org.bukkit.event.inventory.ClickType getClickType(int mode, int button, int slot)
mode
- The raw mode number.button
- The raw button number.slot
- The raw slot number.public static org.bukkit.event.inventory.InventoryAction getAction(org.bukkit.event.inventory.ClickType clickType, org.bukkit.event.inventory.InventoryType.SlotType slot, org.bukkit.inventory.ItemStack cursor, org.bukkit.inventory.ItemStack slotItem)
clickType
- The click type.slot
- The slot clicked.cursor
- The item on the cursor.slotItem
- The item in the slot.public static boolean isPlaceAction(org.bukkit.event.inventory.InventoryAction action)
action
- The InventoryAction.public static boolean isPickupAction(org.bukkit.event.inventory.InventoryAction action)
action
- The InventoryAction.Copyright © 2021. All rights reserved.