aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/unapplied/api/0039-Arrow-pickup-rule-API.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/unapplied/api/0039-Arrow-pickup-rule-API.patch')
-rw-r--r--patches/unapplied/api/0039-Arrow-pickup-rule-API.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/patches/unapplied/api/0039-Arrow-pickup-rule-API.patch b/patches/unapplied/api/0039-Arrow-pickup-rule-API.patch
new file mode 100644
index 0000000000..fb3753f0e1
--- /dev/null
+++ b/patches/unapplied/api/0039-Arrow-pickup-rule-API.patch
@@ -0,0 +1,49 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jedediah Smith <[email protected]>
+Date: Fri, 4 Mar 2016 03:13:18 -0500
+Subject: [PATCH] Arrow pickup rule API
+
+
+diff --git a/src/main/java/org/bukkit/entity/AbstractArrow.java b/src/main/java/org/bukkit/entity/AbstractArrow.java
+index 5b50a4e10e8ace8cc53ad3c8d7c3185f88d5c8db..e8e56e89e32d84af0639fe2e9b0eeabd747b6007 100644
+--- a/src/main/java/org/bukkit/entity/AbstractArrow.java
++++ b/src/main/java/org/bukkit/entity/AbstractArrow.java
+@@ -141,4 +141,38 @@ public interface AbstractArrow extends Projectile {
+ */
+ CREATIVE_ONLY
+ }
++
++ // 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
++ * @deprecated Use {@link Arrow#getPickupStatus()} as an upstream compatible replacement for this function
++ */
++ @Deprecated
++ default PickupRule getPickupRule() {
++ return PickupRule.valueOf(this.getPickupStatus().name());
++ }
++
++ /**
++ * Set the rule for which players can pickup this arrow as an item.
++ *
++ * @param rule The pickup rule
++ * @deprecated Use {@link Arrow#setPickupStatus(PickupStatus)} with {@link PickupStatus} as an upstream compatible replacement for this function
++ */
++ @Deprecated
++ default void setPickupRule(PickupRule rule) {
++ this.setPickupStatus(PickupStatus.valueOf(rule.name()));
++ }
++
++ @Deprecated
++ enum PickupRule {
++ DISALLOWED,
++ ALLOWED,
++ CREATIVE_ONLY;
++ }
++ // Paper end
+ }