Add methods to get and set arrow knockback. Adds BUKKIT-5103

This commit is contained in:
Likaos authored and Nate Mortensen committed 2014-01-30 21:47:44 -07:00
1 parent 7f22899456
commit fb8c5547b3
2 files changed
+11 -1

No files matched your search

@@ -21,7 +21,7 @@ public class EntityArrow extends Entity implements IProjectile {
private int j;
private int au;
private double damage = 2.0D;
private int aw;
public int aw; // CraftBukkit - private -> public
public EntityArrow(World world) {
super(world);
@@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.entity;
import net.minecraft.server.EntityArrow;
import org.apache.commons.lang.Validate;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.EntityType;
@@ -27,6 +28,15 @@ public class CraftArrow extends AbstractProjectile implements Arrow {
}
}
public void setKnockbackStrength(int knockbackStrength) {
Validate.isTrue(knockbackStrength >= 0, "Knockback cannot be negative");
getHandle().a(knockbackStrength);
}
public int getKnockbackStrength() {
return getHandle().aw;
}
@Override
public EntityArrow getHandle() {
return (EntityArrow) entity;