mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 15:30:19 +01:00
Add helpers for left/right click to Action
This commit is contained in:
parent
d445af24a5
commit
ec4a7e5d87
1 changed files with 21 additions and 1 deletions
|
@ -29,5 +29,25 @@ public enum Action {
|
|||
* <li>Triggering tripwire
|
||||
* </ul>
|
||||
*/
|
||||
PHYSICAL,
|
||||
// Paper start
|
||||
PHYSICAL;
|
||||
|
||||
/**
|
||||
* Gets whether this action is a result of a left click.
|
||||
*
|
||||
* @return Whether it's a left click
|
||||
*/
|
||||
public boolean isLeftClick() {
|
||||
return this == LEFT_CLICK_AIR || this == LEFT_CLICK_BLOCK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets whether this action is a result of a right click.
|
||||
*
|
||||
* @return Whether it's a right click
|
||||
*/
|
||||
public boolean isRightClick() {
|
||||
return this == RIGHT_CLICK_AIR || this == RIGHT_CLICK_BLOCK;
|
||||
}
|
||||
// Paper end
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue