2017-01-06 22:45:59 +01:00
|
|
|
From e66a13a63d87c0064d5ae21c8c5215f2d2433212 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
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/entity/Arrow.java b/src/main/java/org/bukkit/entity/Arrow.java
|
|
|
|
index e7a32f7..08095b9 100644
|
|
|
|
--- a/src/main/java/org/bukkit/entity/Arrow.java
|
|
|
|
+++ b/src/main/java/org/bukkit/entity/Arrow.java
|
|
|
|
@@ -40,6 +40,31 @@ public interface Arrow extends Projectile {
|
|
|
|
*/
|
|
|
|
public void setCritical(boolean critical);
|
|
|
|
|
|
|
|
+ // 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
|
|
|
|
+ */
|
|
|
|
+ PickupRule getPickupRule();
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Set the rule for which players can pickup this arrow as an item.
|
|
|
|
+ *
|
|
|
|
+ * @param rule The pickup rule
|
|
|
|
+ */
|
|
|
|
+ void setPickupRule(PickupRule rule);
|
|
|
|
+
|
|
|
|
+ enum PickupRule {
|
|
|
|
+ DISALLOWED,
|
|
|
|
+ ALLOWED,
|
|
|
|
+ CREATIVE_ONLY;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
public class Spigot extends Entity.Spigot
|
|
|
|
{
|
|
|
|
|
|
|
|
--
|
2017-01-06 22:45:59 +01:00
|
|
|
2.9.3
|
2016-04-22 09:07:16 +02:00
|
|
|
|