PocketMine-MP 5.37.4 git-dbb3eefc44d5dddb20f540594fbda61467f50873
Loading...
Searching...
No Matches
pocketmine\network\mcpe\convert\ItemTranslator Class Reference
+ Collaboration diagram for pocketmine\network\mcpe\convert\ItemTranslator:

Public Member Functions

 __construct (private ItemTypeDictionary $itemTypeDictionary, private BlockStateDictionary $blockStateDictionary, private ItemSerializer $itemSerializer, private ItemDeserializer $itemDeserializer, private BlockItemIdMap $blockItemIdMap)
 
 fromNetworkId (int $networkId, int $networkMeta, int $networkBlockRuntimeId)
 
 toNetworkId (Item $item)
 
 toNetworkIdQuiet (Item $item)
 
 toNetworkNbt (Item $item)
 

Public Attributes

const NO_BLOCK_RUNTIME_ID = 0
 

Detailed Description

This class handles translation between network item ID+metadata to PocketMine-MP internal ID+metadata and vice versa.

Definition at line 40 of file ItemTranslator.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\network\mcpe\convert\ItemTranslator::__construct ( private ItemTypeDictionary $itemTypeDictionary,
private BlockStateDictionary $blockStateDictionary,
private ItemSerializer $itemSerializer,
private ItemDeserializer $itemDeserializer,
private BlockItemIdMap $blockItemIdMap )

Definition at line 43 of file ItemTranslator.php.

Member Function Documentation

◆ fromNetworkId()

pocketmine\network\mcpe\convert\ItemTranslator::fromNetworkId ( int $networkId,
int $networkMeta,
int $networkBlockRuntimeId )
Exceptions
TypeConversionException

Definition at line 102 of file ItemTranslator.php.

◆ toNetworkId()

pocketmine\network\mcpe\convert\ItemTranslator::toNetworkId ( Item $item)
Returns
int[] @phpstan-return array{int, int, ?int}
Exceptions
ItemTypeSerializeException

Definition at line 69 of file ItemTranslator.php.

◆ toNetworkIdQuiet()

pocketmine\network\mcpe\convert\ItemTranslator::toNetworkIdQuiet ( Item $item)
Returns
int[]|null @phpstan-return array{int, int, ?int}|null

Definition at line 55 of file ItemTranslator.php.

◆ toNetworkNbt()

pocketmine\network\mcpe\convert\ItemTranslator::toNetworkNbt ( Item $item)
Exceptions
ItemTypeSerializeException

Definition at line 92 of file ItemTranslator.php.

Member Data Documentation

◆ NO_BLOCK_RUNTIME_ID

const pocketmine\network\mcpe\convert\ItemTranslator::NO_BLOCK_RUNTIME_ID = 0

Definition at line 41 of file ItemTranslator.php.


The documentation for this class was generated from the following file: