From 6f94f00f7bc0077a16350d8442322ff9c7873427 Mon Sep 17 00:00:00 2001 From: Maddy Miller Date: Sun, 29 Aug 2021 16:29:36 +1000 Subject: [PATCH] Add helpers for left/right hand to Action (#6517) * Add helpers for left/right hand to Action * Diff starts here technically --- ...elpers-for-left-right-hand-to-Action.patch | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 patches/api/Add-helpers-for-left-right-hand-to-Action.patch diff --git a/patches/api/Add-helpers-for-left-right-hand-to-Action.patch b/patches/api/Add-helpers-for-left-right-hand-to-Action.patch new file mode 100644 index 0000000000..552fa097dd --- /dev/null +++ b/patches/api/Add-helpers-for-left-right-hand-to-Action.patch @@ -0,0 +1,37 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Madeline Miller +Date: Sun, 29 Aug 2021 16:22:46 +1000 +Subject: [PATCH] Add helpers for left/right hand to Action + + +diff --git a/src/main/java/org/bukkit/event/block/Action.java b/src/main/java/org/bukkit/event/block/Action.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/event/block/Action.java ++++ b/src/main/java/org/bukkit/event/block/Action.java +@@ -0,0 +0,0 @@ public enum Action { + *
  • Triggering tripwire + * + */ +- PHYSICAL, ++ // Paper start ++ PHYSICAL; ++ ++ /** ++ * Gets whether this action is a result of a left-hand click. ++ * ++ * @return Whether it's a left-hand click ++ */ ++ public boolean isLeftHand() { ++ return this == LEFT_CLICK_AIR || this == LEFT_CLICK_BLOCK; ++ } ++ ++ /** ++ * Gets whether this action is a result of a right-hand click. ++ * ++ * @return Whether it's a right-hand click ++ */ ++ public boolean isRightHand() { ++ return this == RIGHT_CLICK_AIR || this == RIGHT_CLICK_BLOCK; ++ } ++ // Paper end + }