diff options
author | Likaos <romain.rosique@gmail.com> | 2013-12-16 22:30:13 -0500 |
---|---|---|
committer | Nate Mortensen <nate.richard.mortensen@gmail.com> | 2014-01-30 21:47:44 -0700 |
commit | fb8c5547b3e8f2b44567b68c3232a4b5db3e9f0c (patch) | |
tree | 710929e13fd36e0dbee4be4f4b3394851a243d84 /src/main/java | |
parent | 7f2289945663c89f20bcc8bfde1124af42620a7c (diff) | |
download | craftbukkit-fb8c5547b3e8f2b44567b68c3232a4b5db3e9f0c.tar craftbukkit-fb8c5547b3e8f2b44567b68c3232a4b5db3e9f0c.tar.gz craftbukkit-fb8c5547b3e8f2b44567b68c3232a4b5db3e9f0c.tar.lz craftbukkit-fb8c5547b3e8f2b44567b68c3232a4b5db3e9f0c.tar.xz craftbukkit-fb8c5547b3e8f2b44567b68c3232a4b5db3e9f0c.zip |
Add methods to get and set arrow knockback. Adds BUKKIT-5103
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityArrow.java | 2 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java index 4b3e5dd5..efa05ba2 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java @@ -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); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java index b46b9c4c..bea6067c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java +++ b/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; |