Add helpers for left/right click to Action

This commit is contained in:
Madeline Miller 2021-08-29 17:00:56 +10:00
parent d445af24a5
commit ec4a7e5d87

View file

@ -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
}