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

Public Member Functions

 __construct (RootNode $root_node=null)
 
 addCommand (Command &$command, string $prefix="")
 
 send (Connection $con)
 
 __toString ()
 

Static Public Member Functions

static read (Connection $con)
 
static recursivelyFlatten (Node &$node)
 

Public Attributes

 $root_node
 

Constructor & Destructor Documentation

◆ __construct()

Phpcraft\Packet\DeclareCommands\DeclareCommandsPacket::__construct ( RootNode  $root_node = null)

Member Function Documentation

◆ __toString()

Phpcraft\Packet\DeclareCommands\DeclareCommandsPacket::__toString ( )

Reimplemented from Phpcraft\Packet\Packet.

◆ addCommand()

Phpcraft\Packet\DeclareCommands\DeclareCommandsPacket::addCommand ( Command $command,
string  $prefix = "" 
)
Parameters
Command$command
string$prefix
Returns
DeclareCommandsPacket

◆ read()

static Phpcraft\Packet\DeclareCommands\DeclareCommandsPacket::read ( Connection  $con)
static

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

Parameters
Connection$con
Returns
DeclareCommandsPacket
Exceptions
IOException

Reimplemented from Phpcraft\Packet\Packet.

◆ recursivelyFlatten()

static Phpcraft\Packet\DeclareCommands\DeclareCommandsPacket::recursivelyFlatten ( Node $node)
static
Parameters
Node$node
Returns
Node[]

◆ send()

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

◆ $root_node

RootNode Phpcraft\Packet\DeclareCommands\DeclareCommandsPacket::$root_node