From a9bd4e23266fde86c4cd07242c103e9d996113b0 Mon Sep 17 00:00:00 2001 From: Snowiiii Date: Wed, 7 Aug 2024 14:42:52 +0200 Subject: [PATCH] Add Clientbound Entity Metadata --- .../src/client/play/c_entity_metadata.rs | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 pumpkin-protocol/src/client/play/c_entity_metadata.rs diff --git a/pumpkin-protocol/src/client/play/c_entity_metadata.rs b/pumpkin-protocol/src/client/play/c_entity_metadata.rs new file mode 100644 index 000000000..506adcb32 --- /dev/null +++ b/pumpkin-protocol/src/client/play/c_entity_metadata.rs @@ -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, +} + +impl CSetEntityMetadata { + pub fn new(entity_id: VarInt, metadata: Vec) -> 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 } + } +}