From 7fdc749bf17b8a80b931f58ad4ac101d4b20676e Mon Sep 17 00:00:00 2001 From: xGhOsTkiLLeRx Date: Wed, 18 Jan 2017 10:01:28 +1100 Subject: [PATCH] Add API to set Arrow pickup status --- .../org/bukkit/craftbukkit/entity/CraftArrow.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java index dca8520464..0e1d93432d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java @@ -1,5 +1,6 @@ package org.bukkit.craftbukkit.entity; +import com.google.common.base.Preconditions; import net.minecraft.server.EntityArrow; import org.apache.commons.lang.Validate; @@ -33,7 +34,7 @@ public class CraftArrow extends AbstractProjectile implements Arrow { } public ProjectileSource getShooter() { - return getHandle().projectileSource; + return getHandle().projectileSource; } public void setShooter(ProjectileSource shooter) { @@ -45,6 +46,17 @@ public class CraftArrow extends AbstractProjectile implements Arrow { getHandle().projectileSource = shooter; } + @Override + public PickupStatus getPickupStatus() { + return PickupStatus.values()[getHandle().fromPlayer.ordinal()]; + } + + @Override + public void setPickupStatus(PickupStatus status) { + Preconditions.checkNotNull(status, "status"); + getHandle().fromPlayer = EntityArrow.PickupStatus.a(status.ordinal()); + } + @Override public EntityArrow getHandle() { return (EntityArrow) entity;