2019-06-06 17:36:57 +02:00
|
|
|
From f60334f986fa97b67906ca99d7f655a4b757e8b7 Mon Sep 17 00:00:00 2001
|
2016-04-22 09:07:16 +02:00
|
|
|
From: Jedediah Smith <jedediah@silencegreys.com>
|
|
|
|
Date: Fri, 4 Mar 2016 03:13:18 -0500
|
|
|
|
Subject: [PATCH] Arrow pickup rule API
|
|
|
|
|
|
|
|
|
2019-05-06 04:58:04 +02:00
|
|
|
diff --git a/src/main/java/org/bukkit/entity/AbstractArrow.java b/src/main/java/org/bukkit/entity/AbstractArrow.java
|
2019-06-06 17:36:57 +02:00
|
|
|
index 4460f6c9e..a1990fef2 100644
|
2019-05-06 04:58:04 +02:00
|
|
|
--- a/src/main/java/org/bukkit/entity/AbstractArrow.java
|
|
|
|
+++ b/src/main/java/org/bukkit/entity/AbstractArrow.java
|
|
|
|
@@ -111,4 +111,38 @@ public interface AbstractArrow extends Projectile {
|
|
|
|
*/
|
|
|
|
CREATIVE_ONLY
|
|
|
|
}
|
2017-05-15 18:25:20 +02:00
|
|
|
+
|
2016-04-22 09:07:16 +02:00
|
|
|
+ // Paper start
|
|
|
|
+ /**
|
|
|
|
+ * Gets the {@link PickupRule} for this arrow.
|
|
|
|
+ *
|
|
|
|
+ * <p>This is generally {@link PickupRule#ALLOWED} only if the arrow was
|
|
|
|
+ * <b>not</b> fired from a bow with the infinity enchantment.</p>
|
|
|
|
+ *
|
|
|
|
+ * @return The pickup rule
|
2017-01-20 12:21:44 +01:00
|
|
|
+ * @deprecated Use {@link Arrow#getPickupStatus()} as an upstream compatible replacement for this function
|
2016-04-22 09:07:16 +02:00
|
|
|
+ */
|
2017-01-20 12:21:44 +01:00
|
|
|
+ @Deprecated
|
|
|
|
+ default PickupRule getPickupRule() {
|
|
|
|
+ return PickupRule.valueOf(this.getPickupStatus().name());
|
|
|
|
+ }
|
2016-04-22 09:07:16 +02:00
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Set the rule for which players can pickup this arrow as an item.
|
|
|
|
+ *
|
|
|
|
+ * @param rule The pickup rule
|
2017-01-20 12:21:44 +01:00
|
|
|
+ * @deprecated Use {@link Arrow#setPickupStatus(PickupStatus)} with {@link PickupStatus} as an upstream compatible replacement for this function
|
2016-04-22 09:07:16 +02:00
|
|
|
+ */
|
2017-01-20 12:21:44 +01:00
|
|
|
+ @Deprecated
|
|
|
|
+ default void setPickupRule(PickupRule rule) {
|
|
|
|
+ this.setPickupStatus(PickupStatus.valueOf(rule.name()));
|
|
|
|
+ }
|
2016-04-22 09:07:16 +02:00
|
|
|
+
|
2017-01-20 12:21:44 +01:00
|
|
|
+ @Deprecated
|
2016-04-22 09:07:16 +02:00
|
|
|
+ enum PickupRule {
|
|
|
|
+ DISALLOWED,
|
|
|
|
+ ALLOWED,
|
|
|
|
+ CREATIVE_ONLY;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
2017-05-15 18:25:20 +02:00
|
|
|
}
|
2016-04-22 09:07:16 +02:00
|
|
|
--
|
2019-03-20 01:28:15 +01:00
|
|
|
2.21.0
|
2016-04-22 09:07:16 +02:00
|
|
|
|