From bc0b8a53cb6ce795d2ce85037c432db3c464de4a Mon Sep 17 00:00:00 2001 From: Jedediah Smith 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 88cebc004..b2bf62a50 100644 --- a/src/main/java/org/bukkit/entity/AbstractArrow.java +++ b/src/main/java/org/bukkit/entity/AbstractArrow.java @@ -127,4 +127,38 @@ public interface AbstractArrow extends Projectile { */ CREATIVE_ONLY } + + // Paper start + /** + * Gets the {@link PickupRule} for this arrow. + * + *

This is generally {@link PickupRule#ALLOWED} only if the arrow was + * not fired from a bow with the infinity enchantment.

+ * + * @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 } -- 2.26.2