SPIGOT-7326: Add ClickType#isMouseClick()

By: TheRealRyGuy <git@ryguy.me>
This commit is contained in:
Bukkit/Spigot 2023-06-15 20:27:43 +10:00
parent 50d16687d4
commit 6b90c83282

View File

@ -75,7 +75,17 @@ public enum ClickType {
* @return true if this ClickType represents the pressing of a key
*/
public boolean isKeyboardClick() {
return (this == ClickType.NUMBER_KEY) || (this == ClickType.DROP) || (this == ClickType.CONTROL_DROP);
return (this == ClickType.NUMBER_KEY) || (this == ClickType.DROP) || (this == ClickType.CONTROL_DROP) || (this == ClickType.SWAP_OFFHAND);
}
/**
* Gets whether this ClickType represents the pressing of a mouse button
*
* @return true if this ClickType represents the pressing of a mouse button
*/
public boolean isMouseClick() {
return (this == ClickType.DOUBLE_CLICK) || (this == ClickType.LEFT) || (this == ClickType.RIGHT) || (this == ClickType.MIDDLE)
|| (this == ClickType.WINDOW_BORDER_LEFT) || (this == ClickType.SHIFT_LEFT) || (this == ClickType.SHIFT_RIGHT) || (this == ClickType.WINDOW_BORDER_RIGHT);
}
/**