From 616d88c60485a322319f319767d94e37bd9ace3d Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Mon, 16 Dec 2013 22:30:13 -0500 Subject: [PATCH] Add methods to get and set arrow knockback. Adds BUKKIT-5103 By: Likaos --- .../java/org/bukkit/craftbukkit/entity/CraftArrow.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java index b46b9c4cc7..bea6067c1e 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java @@ -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;