Pumpkin/pumpkin-protocol/src/java/client/play/cookie_request.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

23 lines
797 B
Rust

use pumpkin_data::packet::clientbound::PLAY_COOKIE_REQUEST;
use pumpkin_macros::java_packet;
use pumpkin_util::resource_location::ResourceLocation;
use serde::Serialize;
/// Sent by the server to request a "cookie" (stored data) from the client.
///
/// Introduced in modern Minecraft versions, cookies allow servers to store
/// small amounts of persistent data on the client side that can be retrieved
/// even across different server instances or sub-servers in a network.
#[derive(Serialize)]
#[java_packet(PLAY_COOKIE_REQUEST)]
pub struct CPlayCookieRequest<'a> {
/// The unique identifier (namespace:path) of the cookie to retrieve.
pub key: &'a ResourceLocation,
}
impl<'a> CPlayCookieRequest<'a> {
pub fn new(key: &'a ResourceLocation) -> Self {
Self { key }
}
}