Documentation

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
phpstan-var

array<int, array<int, int>>

$complexNetToCoreMapping

[internalId, metadata] = array[runtimeId]

private array<string|int, array<string|int, int>> $complexNetToCoreMapping = []
Tags
phpstan-var

array<int, array{int, int}>

$simpleCoreToNetMapping

private array<string|int, int> $simpleCoreToNetMapping = []
Tags
phpstan-var

array<int, int>

$simpleNetToCoreMapping

private array<string|int, int> $simpleNetToCoreMapping = []
Tags
phpstan-var

array<int, int>

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
phpstan-param

array<string, int> $simpleMappings

phpstan-param

array<string, array<int, int>> $complexMappings

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
phpstan-return

array{int, int}

throws
TypeConversionException
Return values
array<string|int, int>

fromNetworkIdWithWildcardHandling()

public fromNetworkIdWithWildcardHandling(int $networkId, int $networkMeta) : array<string|int, int>
Parameters
$networkId : int
$networkMeta : int
Tags
phpstan-return

array{int, int}

throws
TypeConversionException
Return values
array<string|int, int>

getInstance()

public static getInstance() : self
Return values
self

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
phpstan-return

array{int, int}

Return values
array<string|int, int>

toNetworkIdQuiet()

public toNetworkIdQuiet(int $internalId, int $internalMeta) : array<string|int, int>|null
Parameters
$internalId : int
$internalMeta : int
Tags
phpstan-return

array{int, int}|null

Return values
array<string|int, int>|null

Search results