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

Public Member Functions

 __construct ($eid=0)
 
 send (Connection $con)
 
 __toString ()
 

Static Public Member Functions

static read (Connection $con)
 

Public Attributes

 $eid
 
 $gamemode = Gamemode::SURVIVAL
 
 $hardcore = false
 
 $dimension = Dimension::OVERWORLD
 
 $render_distance = 8
 
 $enable_respawn_screen = true
 

Detailed Description

The first packet sent to the client after they've logged in.

Constructor & Destructor Documentation

◆ __construct()

Phpcraft\Packet\JoinGamePacket::__construct (   $eid = 0)
Parameters
GMP | int | string$eid

Member Function Documentation

◆ __toString()

Phpcraft\Packet\JoinGamePacket::__toString ( )

Reimplemented from Phpcraft\Packet\Packet.

◆ read()

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

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

Parameters
Connection$con
Returns
JoinGamePacket
Exceptions
IOException

Reimplemented from Phpcraft\Packet\Packet.

◆ send()

Phpcraft\Packet\JoinGamePacket::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

◆ $dimension

int Phpcraft\Packet\JoinGamePacket::$dimension = Dimension::OVERWORLD

Note: This value is sent and read as overworld in 1.16.

◆ $eid

GMP Phpcraft\Packet\JoinGamePacket::$eid

◆ $enable_respawn_screen

bool Phpcraft\Packet\JoinGamePacket::$enable_respawn_screen = true

Set to false when the doImmediateRespawn gamerule is true. Only for 1.15+ clients.

Since
0.5.1

◆ $gamemode

int Phpcraft\Packet\JoinGamePacket::$gamemode = Gamemode::SURVIVAL

◆ $hardcore

bool Phpcraft\Packet\JoinGamePacket::$hardcore = false

◆ $render_distance

int Phpcraft\Packet\JoinGamePacket::$render_distance = 8