mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 05:47:45 +01:00
SPIGOT-7326: Add ClickType#isMouseClick()
By: TheRealRyGuy <git@ryguy.me>
This commit is contained in:
parent
50d16687d4
commit
6b90c83282
@ -75,7 +75,17 @@ public enum ClickType {
|
|||||||
* @return true if this ClickType represents the pressing of a key
|
* @return true if this ClickType represents the pressing of a key
|
||||||
*/
|
*/
|
||||||
public boolean isKeyboardClick() {
|
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 New Issue
Block a user