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

Public Member Functions

 getInstance (?Connection $con=null)
 
 getClass ()
 
- Public Member Functions inherited from Phpcraft\Identifier
 getId (int $protocol_version)
 

Protected Member Functions

 _getId (int $protocol_version, string $key)
 
- Protected Member Functions inherited from Phpcraft\Identifier
 __construct (string $name, int $since_protocol_version)
 

Static Protected Member Functions

static populateAllCache ()
 
static populateAllCache_ (string $key)
 
static nameMap ()
 

Static Protected Attributes

static $all_cache
 
- Static Protected Attributes inherited from Phpcraft\Identifier
static $all_cache
 

Additional Inherited Members

- Static Public Member Functions inherited from Phpcraft\Identifier
static get (string $name)
 
static getById (int $id, int $protocol_version)
 
static all ()
 
- Public Attributes inherited from Phpcraft\Identifier
 $name
 
 $since_protocol_version
 

Member Function Documentation

◆ _getId()

Phpcraft\Packet\PacketId::_getId ( int  $protocol_version,
string  $key 
)
protected

◆ getClass()

Phpcraft\Packet\PacketId::getClass ( )
abstract

Returns the packet's class or null if the packet does not have a class implementation yet.

Returns
string|null

Reimplemented in Phpcraft\Packet\ClientboundPacketId, and Phpcraft\Packet\ServerboundPacketId.

◆ getInstance()

Phpcraft\Packet\PacketId::getInstance ( ?Connection  $con = null)

Initialises this packet's class, optionally reading its payload from the given Connection. Returns null if the packet does not have a class implementation yet.

Parameters
Connection | null$con
Returns
Packet|null
Exceptions
IOException

◆ nameMap()

static Phpcraft\Packet\PacketId::nameMap ( )
staticabstractprotected

◆ populateAllCache()

static Phpcraft\Packet\PacketId::populateAllCache ( )
staticprotected

◆ populateAllCache_()

static Phpcraft\Packet\PacketId::populateAllCache_ ( string  $key)
staticprotected

Member Data Documentation

◆ $all_cache

Phpcraft\Packet\PacketId::$all_cache
staticprotected