Its works, but block state ids are currently not mapped, meaning that when using the current default world gen the client mostly will disconnect due to a not found block state id, vanilla version compatible worlds should work
32 lines
807 B
Rust
32 lines
807 B
Rust
use crate::VarInt;
|
|
use crate::codec::item_stack_seralizer::ItemStackSerializer;
|
|
|
|
use pumpkin_data::packet::clientbound::PLAY_CONTAINER_SET_CONTENT;
|
|
use pumpkin_macros::java_packet;
|
|
use serde::Serialize;
|
|
|
|
#[derive(Serialize)]
|
|
#[java_packet(PLAY_CONTAINER_SET_CONTENT)]
|
|
pub struct CSetContainerContent<'a> {
|
|
pub window_id: VarInt,
|
|
pub state_id: VarInt,
|
|
pub slot_data: &'a [ItemStackSerializer<'a>],
|
|
pub carried_item: &'a ItemStackSerializer<'a>,
|
|
}
|
|
|
|
impl<'a> CSetContainerContent<'a> {
|
|
pub fn new(
|
|
window_id: VarInt,
|
|
state_id: VarInt,
|
|
slots: &'a [ItemStackSerializer],
|
|
carried_item: &'a ItemStackSerializer,
|
|
) -> Self {
|
|
Self {
|
|
window_id,
|
|
state_id,
|
|
slot_data: slots,
|
|
carried_item,
|
|
}
|
|
}
|
|
}
|