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; package org.bukkit.craftbukkit.entity;
import com.google.common.base.Preconditions;
import net.minecraft.server.EntityArrow; import net.minecraft.server.EntityArrow;
import org.apache.commons.lang.Validate; import org.apache.commons.lang.Validate;
@ -33,7 +34,7 @@ public class CraftArrow extends AbstractProjectile implements Arrow {
} }
public ProjectileSource getShooter() { public ProjectileSource getShooter() {
return getHandle().projectileSource; return getHandle().projectileSource;
} }
public void setShooter(ProjectileSource shooter) { public void setShooter(ProjectileSource shooter) {
@ -45,6 +46,17 @@ public class CraftArrow extends AbstractProjectile implements Arrow {
getHandle().projectileSource = shooter; 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 @Override
public EntityArrow getHandle() { public EntityArrow getHandle() {
return (EntityArrow) entity; return (EntityArrow) entity;