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

Public Member Functions

 __construct (int $difficulty)
 
 send (Connection $con)
 
 __toString ()
 

Static Public Member Functions

static read (Connection $con)
 

Public Attributes

 $difficulty
 

Detailed Description

Server-to-client.

Since
0.5.9

Constructor & Destructor Documentation

◆ __construct()

Phpcraft\Packet\DifficultyPacket::__construct ( int  $difficulty)

Member Function Documentation

◆ __toString()

Phpcraft\Packet\DifficultyPacket::__toString ( )

Reimplemented from Phpcraft\Packet\Packet.

◆ read()

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

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

Parameters
Connection$con
Returns
DifficultyPacket
Exceptions
IOException

Reimplemented from Phpcraft\Packet\Packet.

◆ send()

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

◆ $difficulty

int Phpcraft\Packet\DifficultyPacket::$difficulty