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

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

Dieser Commit ist enthalten in:
Likaos 2013-12-16 22:30:13 -05:00 committet von Nate Mortensen
Ursprung 7f22899456
Commit fb8c5547b3
2 geänderte Dateien mit 11 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -21,7 +21,7 @@ public class EntityArrow extends Entity implements IProjectile {
private int j; private int j;
private int au; private int au;
private double damage = 2.0D; private double damage = 2.0D;
private int aw; public int aw; // CraftBukkit - private -> public
public EntityArrow(World world) { public EntityArrow(World world) {
super(world); super(world);

Datei anzeigen

@ -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;