1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-01-30 19:40:37 +01:00

Arrow pickup rule API

This commit is contained in:
Jedediah Smith 2016-03-04 03:13:18 -05:00
parent 21575c024f
commit bcd6aecdab

View file

@ -186,4 +186,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
}