mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
SPIGOT-7326: Add ClickType#isMouseClick()
By: TheRealRyGuy <git@ryguy.me>
This commit is contained in:
parent
50d16687d4
commit
6b90c83282
1 changed files with 11 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue