3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 12:30:06 +01:00

Add API to set Arrow pickup status

Dieser Commit ist enthalten in:
xGhOsTkiLLeRx 2017-01-18 10:01:28 +11:00 committet von md_5
Ursprung 775f1e1f7f
Commit 7fdc749bf1

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;