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

Public Member Functions

 getId (int $protocol_version)
 

Static Public Member Functions

static get (string $name)
 
static getById (int $id, int $protocol_version)
 
static all ()
 

Public Attributes

 $name
 
 $since_protocol_version
 

Protected Member Functions

 __construct (string $name, int $since_protocol_version)
 

Static Protected Member Functions

static populateAllCache ()
 

Static Protected Attributes

static $all_cache
 

Constructor & Destructor Documentation

◆ __construct()

Phpcraft\Identifier::__construct ( string  $name,
int  $since_protocol_version 
)
protected

Reimplemented in Phpcraft\Entity\EntityType.

Member Function Documentation

◆ all()

static Phpcraft\Identifier::all ( )
static

Returns everything of this type.

Returns
array<static>

◆ get()

static Phpcraft\Identifier::get ( string  $name)
static

Returns an Identifier by its name or null if not found.

Parameters
string$name
Returns
static|null

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

◆ getById()

static Phpcraft\Identifier::getById ( int  $id,
int  $protocol_version 
)
static

Returns an Identifier by its ID in the given protocol version or null if not found.

Parameters
int$id
int$protocol_version
Returns
static|null

◆ getId()

Phpcraft\Identifier::getId ( int  $protocol_version)
abstract

Returns the ID of this Identifier for the given protocol version or null if not applicable.

Parameters
int$protocol_version
Returns
int|null

Reimplemented in Phpcraft\Entity\EntityType, Phpcraft\Item, Phpcraft\Packet\ClientboundPacketId, Phpcraft\EffectType, and Phpcraft\Packet\ServerboundPacketId.

◆ populateAllCache()

static Phpcraft\Identifier::populateAllCache ( )
staticabstractprotected

Member Data Documentation

◆ $all_cache

Phpcraft\Identifier::$all_cache
staticprotected

◆ $name

string Phpcraft\Identifier::$name

The name of this Identifier.

◆ $since_protocol_version

int Phpcraft\Identifier::$since_protocol_version

The protocol version at which this Identifier was introduced.