Pumpkin/pumpkin-protocol/src/java/client/play/close_container.rs
Alexander Medvedev 186ad2edea feat: 1.21.7-1.21.11 support
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
2026-01-25 23:08:28 +01:00

26 lines
836 B
Rust

use pumpkin_data::packet::clientbound::PLAY_CONTAINER_CLOSE;
use pumpkin_macros::java_packet;
use serde::Serialize;
use crate::VarInt;
/// Notifies the client that a container (inventory, chest, etc.) has been closed.
///
/// This is used by the server to force the player's UI to shut, for example,
/// if the player moves too far away from a chest or if an NPC's trade window
/// is invalidated.
#[derive(Serialize)]
#[java_packet(PLAY_CONTAINER_CLOSE)]
pub struct CCloseContainer {
/// The ID of the container window to close.
///
/// A value of 0 usually refers to the player's own inventory, while higher
/// values refer to active windows opened via previous packets.
pub sync_id: VarInt,
}
impl CCloseContainer {
pub const fn new(window_id: VarInt) -> Self {
Self { sync_id: window_id }
}
}