mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 23:10:16 +01:00
#633: Add LivingEntity#attack, LivingEntity#swingMainHand, LivingEntity#swingOffHand
This commit is contained in:
parent
d5ef2eab9e
commit
f7ab30557e
1 changed files with 18 additions and 0 deletions
|
@ -32,6 +32,7 @@ import net.minecraft.server.EntityTippedArrow;
|
|||
import net.minecraft.server.EntityTypes;
|
||||
import net.minecraft.server.EntityWither;
|
||||
import net.minecraft.server.EntityWitherSkull;
|
||||
import net.minecraft.server.EnumHand;
|
||||
import net.minecraft.server.GenericAttributes;
|
||||
import net.minecraft.server.MobEffect;
|
||||
import net.minecraft.server.MobEffectList;
|
||||
|
@ -583,6 +584,23 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
|||
return (this.getHandle() instanceof EntityInsentient) ? !((EntityInsentient) this.getHandle()).isNoAI(): false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attack(Entity target) {
|
||||
Preconditions.checkArgument(target != null, "target == null");
|
||||
|
||||
getHandle().B(((CraftEntity) target).getHandle()); // PAIL rename attack
|
||||
}
|
||||
|
||||
@Override
|
||||
public void swingMainHand() {
|
||||
getHandle().a(EnumHand.MAIN_HAND); // PAIL rename swingHand
|
||||
}
|
||||
|
||||
@Override
|
||||
public void swingOffHand() {
|
||||
getHandle().a(EnumHand.OFF_HAND); // PAIL rename swingHand
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCollidable(boolean collidable) {
|
||||
getHandle().collides = collidable;
|
||||
|
|
Loading…
Reference in a new issue