Add Clientbound Entity Metadata
This commit is contained in:
parent
4fd8d47d7e
commit
a9bd4e2326
33
pumpkin-protocol/src/client/play/c_entity_metadata.rs
Normal file
33
pumpkin-protocol/src/client/play/c_entity_metadata.rs
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
use pumpkin_macros::packet;
|
||||||
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use crate::VarInt;
|
||||||
|
|
||||||
|
#[derive(Serialize, Clone)]
|
||||||
|
#[packet(0x58)]
|
||||||
|
pub struct CSetEntityMetadata {
|
||||||
|
entity_id: VarInt,
|
||||||
|
metadata: Vec<Metadata>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl CSetEntityMetadata {
|
||||||
|
pub fn new(entity_id: VarInt, metadata: Vec<Metadata>) -> Self {
|
||||||
|
Self {
|
||||||
|
entity_id,
|
||||||
|
metadata,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize, Clone)]
|
||||||
|
pub struct Metadata {
|
||||||
|
index: u8,
|
||||||
|
typ: VarInt,
|
||||||
|
value: u8,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Metadata {
|
||||||
|
pub fn new(index: u8, typ: VarInt, value: u8) -> Self {
|
||||||
|
Self { index, typ, value }
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user