mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 18:27:41 +01:00
Add methods to get and set arrow knockback. Adds BUKKIT-5103
By: Likaos <romain.rosique@gmail.com>
This commit is contained in:
parent
97b317368b
commit
616d88c604
@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.entity;
|
|||||||
|
|
||||||
import net.minecraft.server.EntityArrow;
|
import net.minecraft.server.EntityArrow;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.Validate;
|
||||||
import org.bukkit.craftbukkit.CraftServer;
|
import org.bukkit.craftbukkit.CraftServer;
|
||||||
import org.bukkit.entity.Arrow;
|
import org.bukkit.entity.Arrow;
|
||||||
import org.bukkit.entity.EntityType;
|
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
|
@Override
|
||||||
public EntityArrow getHandle() {
|
public EntityArrow getHandle() {
|
||||||
return (EntityArrow) entity;
|
return (EntityArrow) entity;
|
||||||
|
Loading…
Reference in New Issue
Block a user