class

Rosegold::Clientbound::PlayerInfoUpdate

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

Constants

ADD_PLAYER = 1_u8

Action flags (bitfield)

INITIALIZE_CHAT = 2_u8
PROTOCOL_PACKET_IDS = {772_u32 => 63_u32, 774_u32 => 68_u32, 775_u32 => 70_u32}

Store the protocol mappings as a constant

UPDATE_DISPLAY_NAME = 32_u8
UPDATE_GAMEMODE = 4_u8
UPDATE_HAT = 128_u8
UPDATE_LATENCY = 16_u8
UPDATE_LIST_PRIORITY = 64_u8
UPDATE_LISTED = 8_u8

Constructors

new(actions : UInt8, players : Array(Rosegold::Clientbound::PlayerInfoUpdate::PlayerEntry))
Source

Class methods

[](protocol_version : UInt32) : UInt32

Generate the method for elegant access

Source
add_player(uuid : UUID, name : String, gamemode : Int32 = 0, latency : Int32 = 0, properties : Array(PlayerEntry::Property) | Nil = nil)

Convenience method to create an "Add Player" packet

Source
default_packet_id

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

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
read(packet)
Source
remove_player(uuid : UUID)

Convenience method to remove a player

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

Instance methods

actions
Source
actions=(actions : UInt8)
Source
callback(client)
Source
players
Source
players=(players : Array(PlayerEntry))
Source
write
Source

Nested types