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

Public Member Functions

 getId (int $protocol_version)
 
 getBlock ()
 
 slot (int $count=1, ?NBT $nbt=null)
 

Public Attributes

 $stack_size
 
 $display_name
 
- Public Attributes inherited from Phpcraft\Identifier
 $name
 
 $since_protocol_version
 

Protected Member Functions

 __construct (string $name, int $since_protocol_version, array $ids, int $stack_size, string $display_name)
 
- Protected Member Functions inherited from Phpcraft\Identifier
 __construct (string $name, int $since_protocol_version)
 

Static Protected Member Functions

static populateAllCache ()
 

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 ()
 

Constructor & Destructor Documentation

◆ __construct()

Phpcraft\Item::__construct ( string  $name,
int  $since_protocol_version,
array  $ids,
int  $stack_size,
string  $display_name 
)
protected

Member Function Documentation

◆ getBlock()

Phpcraft\Item::getBlock ( )

Returns the related Block.

Returns
Block

◆ getId()

Phpcraft\Item::getId ( int  $protocol_version)

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

Parameters
int$protocol_version
Returns
int|null

Reimplemented from Phpcraft\Identifier.

◆ populateAllCache()

static Phpcraft\Item::populateAllCache ( )
staticprotected
Returns
void

Reimplemented from Phpcraft\Identifier.

◆ slot()

Phpcraft\Item::slot ( int  $count = 1,
?NBT  $nbt = null 
)

Creates a slot containing this item.

Parameters
int$countHow many times this item is in the slot.
NBT | null$nbtThe NBT data of this item in the slot.
Returns
Slot

Member Data Documentation

◆ $all_cache

Phpcraft\Item::$all_cache
staticprotected

◆ $display_name

string Phpcraft\Item::$display_name

◆ $stack_size

int Phpcraft\Item::$stack_size