32 lines
584 B
Rust
32 lines
584 B
Rust
use pumpkin_data::packet::clientbound::PLAY_ANIMATE;
|
|
use pumpkin_macros::client_packet;
|
|
use serde::Serialize;
|
|
|
|
use crate::VarInt;
|
|
|
|
#[derive(Serialize)]
|
|
#[client_packet(PLAY_ANIMATE)]
|
|
pub struct CEntityAnimation {
|
|
entity_id: VarInt,
|
|
/// See `Animation`
|
|
animation: u8,
|
|
}
|
|
|
|
impl CEntityAnimation {
|
|
pub fn new(entity_id: VarInt, animation: u8) -> Self {
|
|
Self {
|
|
entity_id,
|
|
animation,
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub enum Animation {
|
|
SwingMainArm,
|
|
LeaveBed = 2,
|
|
SwingOffhand,
|
|
CriticalEffect,
|
|
MagicCriticaleffect,
|
|
}
|