include animation methods
This commit is contained in:
parent
26cfb9e630
commit
69e8c2c9b0
1 changed files with 32 additions and 0 deletions
|
@ -1,7 +1,10 @@
|
||||||
package me.tofaa.entitylib.wrapper;
|
package me.tofaa.entitylib.wrapper;
|
||||||
|
|
||||||
import com.github.retrooper.packetevents.protocol.entity.type.EntityType;
|
import com.github.retrooper.packetevents.protocol.entity.type.EntityType;
|
||||||
|
import com.github.retrooper.packetevents.protocol.player.HumanoidArm;
|
||||||
|
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerEntityAnimation;
|
||||||
import me.tofaa.entitylib.meta.EntityMeta;
|
import me.tofaa.entitylib.meta.EntityMeta;
|
||||||
|
import me.tofaa.entitylib.meta.types.LivingEntityMeta;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@ -14,6 +17,35 @@ public class WrapperLivingEntity extends WrapperEntity{
|
||||||
this.equipment = new WrapperEntityEquipment(this);
|
this.equipment = new WrapperEntityEquipment(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void playCriticalHitAnimation() {
|
||||||
|
sendAnimation(WrapperPlayServerEntityAnimation.EntityAnimationType.CRITICAL_HIT);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void playMagicCriticalHitAnimation() {
|
||||||
|
sendAnimation(WrapperPlayServerEntityAnimation.EntityAnimationType.MAGIC_CRITICAL_HIT);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void playWakeupAnimation() {
|
||||||
|
sendAnimation(WrapperPlayServerEntityAnimation.EntityAnimationType.WAKE_UP);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void playHurtAnimation() {
|
||||||
|
sendAnimation(WrapperPlayServerEntityAnimation.EntityAnimationType.HURT);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void swingMainHand() {
|
||||||
|
sendAnimation(WrapperPlayServerEntityAnimation.EntityAnimationType.SWING_MAIN_ARM);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void swingOffHand() {
|
||||||
|
sendAnimation(WrapperPlayServerEntityAnimation.EntityAnimationType.SWING_OFF_HAND);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendAnimation(WrapperPlayServerEntityAnimation.EntityAnimationType type) {
|
||||||
|
sendPacketToViewers(
|
||||||
|
new WrapperPlayServerEntityAnimation(getEntityId(), type)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public WrapperEntityEquipment getEquipment() {
|
public WrapperEntityEquipment getEquipment() {
|
||||||
return equipment;
|
return equipment;
|
||||||
|
|
Loading…
Reference in a new issue