ItemTranslator
in package
Uses
SingletonTrait
This class handles translation between network item ID+metadata to PocketMine-MP internal ID+metadata and vice versa.
Table of Contents
- $complexCoreToNetMapping : array<string|int, array<string|int, int>>
- runtimeId = array[internalId][metadata]
- $complexNetToCoreMapping : array<string|int, array<string|int, int>>
- [internalId, metadata] = array[runtimeId]
- $instance : self|null
- $simpleCoreToNetMapping : array<string|int, int>
- $simpleNetToCoreMapping : array<string|int, int>
- __construct() : mixed
- fromNetworkId() : array<string|int, int>
- fromNetworkIdWithWildcardHandling() : array<string|int, int>
- getInstance() : self
- reset() : void
- setInstance() : void
- toNetworkId() : array<string|int, int>
- toNetworkIdQuiet() : array<string|int, int>|null
- make() : self
Properties
$complexCoreToNetMapping
runtimeId = array[internalId][metadata]
private
array<string|int, array<string|int, int>>
$complexCoreToNetMapping
= []
Tags
$complexNetToCoreMapping
[internalId, metadata] = array[runtimeId]
private
array<string|int, array<string|int, int>>
$complexNetToCoreMapping
= []
Tags
$instance
private
static self|null
$instance
= null
$simpleCoreToNetMapping
private
array<string|int, int>
$simpleCoreToNetMapping
= []
Tags
$simpleNetToCoreMapping
private
array<string|int, int>
$simpleNetToCoreMapping
= []
Tags
Methods
__construct()
public
__construct(ItemTypeDictionary $dictionary, array<string|int, int> $simpleMappings, array<string|int, array<string|int, int>> $complexMappings) : mixed
Parameters
- $dictionary : ItemTypeDictionary
- $simpleMappings : array<string|int, int>
- $complexMappings : array<string|int, array<string|int, int>>
Tags
Return values
mixed —fromNetworkId()
public
fromNetworkId(int $networkId, int $networkMeta[, bool|null &$isComplexMapping = null ]) : array<string|int, int>
Parameters
- $networkId : int
- $networkMeta : int
- $isComplexMapping : bool|null = null
Tags
Return values
array<string|int, int> —fromNetworkIdWithWildcardHandling()
public
fromNetworkIdWithWildcardHandling(int $networkId, int $networkMeta) : array<string|int, int>
Parameters
- $networkId : int
- $networkMeta : int
Tags
Return values
array<string|int, int> —getInstance()
public
static getInstance() : self
Return values
self —reset()
public
static reset() : void
Return values
void —setInstance()
public
static setInstance(self $instance) : void
Parameters
- $instance : self
Return values
void —toNetworkId()
public
toNetworkId(int $internalId, int $internalMeta) : array<string|int, int>
Parameters
- $internalId : int
- $internalMeta : int
Tags
Return values
array<string|int, int> —toNetworkIdQuiet()
public
toNetworkIdQuiet(int $internalId, int $internalMeta) : array<string|int, int>|null
Parameters
- $internalId : int
- $internalMeta : int
Tags
Return values
array<string|int, int>|null —make()
private
static make() : self