13
0
geforkt von Mirrors/Paper

Add API to set Arrow pickup status

By: xGhOsTkiLLeRx <ratchet.player@gmx.de>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2017-01-18 10:01:28 +11:00
Ursprung d6082cde7f
Commit 03cf4ffdf1

Datei anzeigen

@ -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;
@ -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;