class

Rosegold::Serverbound::ClickWindow

Inherits Rosegold::Packets::ProtocolMapping / Rosegold::Serverbound::Packet / Rosegold::Packet / Rosegold::Event / Reference / Object

Constants

PROTOCOL_PACKET_IDS = {772_u32 => 17_u32, 774_u32 => 17_u32, 775_u32 => 18_u32}

Store the protocol mappings as a constant

Constructors

new(mode : Rosegold::Serverbound::ClickWindow::Mode, button : Int8, slot_number : Int16, changed_slots : Array(Rosegold::WindowSlot), window_id : UInt8, state_id : Int32, cursor : Rosegold::Slot)
Source

Class methods

[](protocol_version : UInt32) : UInt32

Generate the method for elegant access

Source
click(window, slot_number, right = false, shift = false, double = false)
Source
default_packet_id

Define default packet ID (typically the latest/most common version)

Source
drop(window, slot_number, stack_mode : StackMode)
Source
drop_cursor(window, stack_mode : StackMode)
Source
packet_id

Provide backward compatibility with existing packet_id class getter Use the first protocol's packet ID for registration compatibility

packet_id_for_protocol(protocol_version : UInt32) : UInt32

Get packet ID for specific protocol version (returns UInt32 for VarInt encoding in write methods)

Source
supported_protocols

Helper method to get all supported protocols

Source
supports_protocol?(protocol_version : UInt32) : Bool

Helper method to check if a protocol is supported

Source
swap_hotbar(window, hotbar_nr, slot_number)

Hotbar starts at 0.

Source
swap_off_hand(window, slot_number)
Source

Instance methods

button
Source
button=(button : Int8)
Source
changed_slots
Source
changed_slots=(changed_slots : Array(WindowSlot))
Source
cursor
Source
cursor=(cursor : Slot)
Source
mode
Source
mode=(mode : Mode)
Source
slot_number
Source
slot_number=(slot_number : Int16)
Source
state_id
Source
state_id=(state_id : Int32)
Source
window_id
Source
window_id=(window_id : UInt8)
Source
write
Source

Nested types