2019-01-01 11:15:55 +08:00
|
|
|
From e711715c7ddc2a309bbcb0156ab188fb95fddd32 Mon Sep 17 00:00:00 2001
|
2016-04-22 15:07:16 +08:00
|
|
|
From: Jedediah Smith <jedediah@silencegreys.com>
|
|
|
|
Date: Fri, 4 Mar 2016 03:13:18 -0500
|
|
|
|
Subject: [PATCH] Arrow pickup rule API
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/entity/Arrow.java b/src/main/java/org/bukkit/entity/Arrow.java
|
2019-01-01 11:15:55 +08:00
|
|
|
index b74d5f9d..99a44006 100644
|
2016-04-22 15:07:16 +08:00
|
|
|
--- a/src/main/java/org/bukkit/entity/Arrow.java
|
|
|
|
+++ b/src/main/java/org/bukkit/entity/Arrow.java
|
2019-01-01 11:15:55 +08:00
|
|
|
@@ -144,4 +144,38 @@ public interface Arrow extends Projectile {
|
2017-05-16 00:25:20 +08:00
|
|
|
@Override
|
|
|
|
Spigot spigot();
|
|
|
|
// Spigot end
|
|
|
|
+
|
2016-04-22 15:07:16 +08: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 19:21:44 +08:00
|
|
|
+ * @deprecated Use {@link Arrow#getPickupStatus()} as an upstream compatible replacement for this function
|
2016-04-22 15:07:16 +08:00
|
|
|
+ */
|
2017-01-20 19:21:44 +08:00
|
|
|
+ @Deprecated
|
|
|
|
+ default PickupRule getPickupRule() {
|
|
|
|
+ return PickupRule.valueOf(this.getPickupStatus().name());
|
|
|
|
+ }
|
2016-04-22 15:07:16 +08:00
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Set the rule for which players can pickup this arrow as an item.
|
|
|
|
+ *
|
|
|
|
+ * @param rule The pickup rule
|
2017-01-20 19:21:44 +08:00
|
|
|
+ * @deprecated Use {@link Arrow#setPickupStatus(PickupStatus)} with {@link PickupStatus} as an upstream compatible replacement for this function
|
2016-04-22 15:07:16 +08:00
|
|
|
+ */
|
2017-01-20 19:21:44 +08:00
|
|
|
+ @Deprecated
|
|
|
|
+ default void setPickupRule(PickupRule rule) {
|
|
|
|
+ this.setPickupStatus(PickupStatus.valueOf(rule.name()));
|
|
|
|
+ }
|
2016-04-22 15:07:16 +08:00
|
|
|
+
|
2017-01-20 19:21:44 +08:00
|
|
|
+ @Deprecated
|
2016-04-22 15:07:16 +08:00
|
|
|
+ enum PickupRule {
|
|
|
|
+ DISALLOWED,
|
|
|
|
+ ALLOWED,
|
|
|
|
+ CREATIVE_ONLY;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
2017-05-16 00:25:20 +08:00
|
|
|
}
|
2016-04-22 15:07:16 +08:00
|
|
|
--
|
2019-01-01 11:15:55 +08:00
|
|
|
2.20.1
|
2016-04-22 15:07:16 +08:00
|
|
|
|