Files
Pumpkin/pumpkin-protocol/src/java/client/play/block_entity_data.rs
Alexander Medvedev e0c91b3edc Initial Bedrock support
You can't join the World, But the base is ready
2025-06-29 00:33:44 +02:00

26 lines
635 B
Rust

use pumpkin_data::packet::clientbound::PLAY_BLOCK_ENTITY_DATA;
use pumpkin_macros::packet;
use pumpkin_util::math::position::BlockPos;
use serde::Serialize;
use crate::{VarInt, ser::network_serialize_no_prefix};
#[derive(Serialize)]
#[packet(PLAY_BLOCK_ENTITY_DATA)]
pub struct CBlockEntityData {
location: BlockPos,
r#type: VarInt,
#[serde(serialize_with = "network_serialize_no_prefix")]
nbt_data: Box<[u8]>,
}
impl CBlockEntityData {
pub fn new(location: BlockPos, r#type: VarInt, nbt_data: Box<[u8]>) -> Self {
Self {
location,
r#type,
nbt_data,
}
}
}