Phpcraft
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Phpcraft\Packet\ClientSettingsPacket Class Reference
Inheritance diagram for Phpcraft\Packet\ClientSettingsPacket:
Inheritance graph
[legend]
Collaboration diagram for Phpcraft\Packet\ClientSettingsPacket:
Collaboration graph
[legend]

Public Member Functions

 send (Connection $con)
 
 __toString ()
 

Static Public Member Functions

static read (Connection $con)
 

Public Attributes

 $locale = "en_GB"
 
 $render_distance = 2
 
 $chat_mode = 0
 
 $chat_colors_enabled = true
 
 $cape_enabled = true
 
 $jacket_enabled = true
 
 $left_sleeve_enabled = true
 
 $right_sleeve_enabled = true
 
 $left_pants_leg_enabled = true
 
 $right_pants_leg_enabled = true
 
 $hat_enabled = true
 
 $left_handed = false
 

Detailed Description

Sent by the client when joining and when settings have been changed.

Member Function Documentation

◆ __toString()

Phpcraft\Packet\ClientSettingsPacket::__toString ( )

Reimplemented from Phpcraft\Packet\Packet.

◆ read()

static Phpcraft\Packet\ClientSettingsPacket::read ( Connection  $con)
static

Initialises the packet class by reading its payload from the given Connection.

Parameters
Connection$con
Returns
ClientSettingsPacket
Exceptions
IOException

Reimplemented from Phpcraft\Packet\Packet.

◆ send()

Phpcraft\Packet\ClientSettingsPacket::send ( Connection  $con)

Adds the packet's ID and payload to the Connection's write buffer and sends it over the wire if the connection has a stream. Note that in some cases this will produce multiple Minecraft packets, therefore you should only use this on connections without a stream if you know what you're doing.

Parameters
Connection$con
Returns
void
Exceptions
IOException

Reimplemented from Phpcraft\Packet\Packet.

Member Data Documentation

◆ $cape_enabled

bool Phpcraft\Packet\ClientSettingsPacket::$cape_enabled = true

◆ $chat_colors_enabled

bool Phpcraft\Packet\ClientSettingsPacket::$chat_colors_enabled = true

◆ $chat_mode

int Phpcraft\Packet\ClientSettingsPacket::$chat_mode = 0

Defines the messages the client accepts:

  • 0: All
  • 1: Only system
  • 2: None

◆ $hat_enabled

bool Phpcraft\Packet\ClientSettingsPacket::$hat_enabled = true

◆ $jacket_enabled

bool Phpcraft\Packet\ClientSettingsPacket::$jacket_enabled = true

◆ $left_handed

bool Phpcraft\Packet\ClientSettingsPacket::$left_handed = false

◆ $left_pants_leg_enabled

bool Phpcraft\Packet\ClientSettingsPacket::$left_pants_leg_enabled = true

◆ $left_sleeve_enabled

bool Phpcraft\Packet\ClientSettingsPacket::$left_sleeve_enabled = true

◆ $locale

string Phpcraft\Packet\ClientSettingsPacket::$locale = "en_GB"

◆ $render_distance

int Phpcraft\Packet\ClientSettingsPacket::$render_distance = 2

◆ $right_pants_leg_enabled

bool Phpcraft\Packet\ClientSettingsPacket::$right_pants_leg_enabled = true

◆ $right_sleeve_enabled

bool Phpcraft\Packet\ClientSettingsPacket::$right_sleeve_enabled = true