mirror of
https://github.com/Pumpkin-MC/Pumpkin.git
synced 2026-08-31 08:22:33 +00:00
* vn translation * feat: blockstate remapping * formatting cleanup * damm dot * damm comma * fix: mapping 1.21.8 tracker * fix: entity metadata * formatting * clippy * fix: item id remap * formatting
31 lines
770 B
Rust
31 lines
770 B
Rust
use std::io::Write;
|
|
|
|
use crate::codec::item_stack_seralizer::ItemStackSerializer;
|
|
use crate::{ClientPacket, WritingError};
|
|
|
|
use pumpkin_data::packet::clientbound::PLAY_SET_CURSOR_ITEM;
|
|
use pumpkin_macros::java_packet;
|
|
use pumpkin_util::version::MinecraftVersion;
|
|
|
|
#[java_packet(PLAY_SET_CURSOR_ITEM)]
|
|
pub struct CSetCursorItem<'a> {
|
|
pub stack: &'a ItemStackSerializer<'a>,
|
|
}
|
|
|
|
impl<'a> CSetCursorItem<'a> {
|
|
#[must_use]
|
|
pub const fn new(stack: &'a ItemStackSerializer<'a>) -> Self {
|
|
Self { stack }
|
|
}
|
|
}
|
|
|
|
impl ClientPacket for CSetCursorItem<'_> {
|
|
fn write_packet_data(
|
|
&self,
|
|
write: impl Write,
|
|
version: &MinecraftVersion,
|
|
) -> Result<(), WritingError> {
|
|
self.stack.write_with_version(write, version)
|
|
}
|
|
}
|