Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-15 02:50:09 +01:00
Add helpers for left/right hand to Action (#6517)
* Add helpers for left/right hand to Action * Diff starts here technically
Dieser Commit ist enthalten in:
Ursprung
be269d1cf0
Commit
785bee00eb
37
patches/api/0332-Add-helpers-for-left-right-hand-to-Action.patch
Normale Datei
37
patches/api/0332-Add-helpers-for-left-right-hand-to-Action.patch
Normale Datei
@ -0,0 +1,37 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Madeline Miller <mnmiller1@me.com>
|
||||
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 25d26e3fe713311e66d7e634a6c32af61f4cef59..839dd6765c7b3338d5fc55d6f336cf7f22bfa959 100644
|
||||
--- a/src/main/java/org/bukkit/event/block/Action.java
|
||||
+++ b/src/main/java/org/bukkit/event/block/Action.java
|
||||
@@ -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-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
|
||||
}
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren