PocketMine-MP 5.15.1 git-fb9a74e8799c71ed8292cfa53abe7a4c9204629d
pocketmine\network\mcpe\convert\TypeConverter Class Reference
+ Collaboration diagram for pocketmine\network\mcpe\convert\TypeConverter:

Public Member Functions

 coreGameModeToProtocol (GameMode $gamemode)
 coreItemStackToNet (Item $itemStack)
 coreRecipeIngredientToNet (?RecipeIngredient $ingredient)
 deserializeItemStackExtraData (string $extraData, int $id)
 getBlockTranslator ()
 getItemTranslator ()
 getItemTypeDictionary ()
 getSkinAdapter ()
 netItemStackToCore (ItemStack $itemStack)
 netRecipeIngredientToCore (ProtocolRecipeIngredient $ingredient)
 protocolGameModeToCore (int $gameMode)
 setSkinAdapter (SkinAdapter $skinAdapter)

Detailed Description

Definition at line 56 of file TypeConverter.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\network\mcpe\convert\TypeConverter::__construct ( )

Definition at line 71 of file TypeConverter.php.

Member Function Documentation

◆ coreGameModeToProtocol()

pocketmine\network\mcpe\convert\TypeConverter::coreGameModeToProtocol ( GameMode  $gamemode)

Returns a client-friendly gamemode of the specified real gamemode This function takes care of handling gamemodes known to MCPE (as of, that includes Survival, Creative and Adventure)

Definition at line 114 of file TypeConverter.php.

◆ coreItemStackToNet()

pocketmine\network\mcpe\convert\TypeConverter::coreItemStackToNet ( Item  $itemStack)

Definition at line 200 of file TypeConverter.php.

◆ coreRecipeIngredientToNet()

pocketmine\network\mcpe\convert\TypeConverter::coreRecipeIngredientToNet ( ?RecipeIngredient  $ingredient)

Definition at line 134 of file TypeConverter.php.

◆ deserializeItemStackExtraData()

pocketmine\network\mcpe\convert\TypeConverter::deserializeItemStackExtraData ( string  $extraData,
int  $id 

Definition at line 273 of file TypeConverter.php.

◆ getBlockTranslator()

pocketmine\network\mcpe\convert\TypeConverter::getBlockTranslator ( )

Definition at line 96 of file TypeConverter.php.

◆ getItemTranslator()

pocketmine\network\mcpe\convert\TypeConverter::getItemTranslator ( )

Definition at line 100 of file TypeConverter.php.

◆ getItemTypeDictionary()

pocketmine\network\mcpe\convert\TypeConverter::getItemTypeDictionary ( )

Definition at line 98 of file TypeConverter.php.

◆ getSkinAdapter()

pocketmine\network\mcpe\convert\TypeConverter::getSkinAdapter ( )

Definition at line 102 of file TypeConverter.php.

◆ netItemStackToCore()

pocketmine\network\mcpe\convert\TypeConverter::netItemStackToCore ( ItemStack  $itemStack)

WARNING: Avoid this in server-side code. If you need to compare ItemStacks provided by the client to the server, prefer encoding the server's itemstack and comparing the serialized ItemStack, instead of converting the client's ItemStack to a core Item. This method will fully decode the item's extra data, which can be very costly if the item has a lot of NBT data.


Definition at line 247 of file TypeConverter.php.

◆ netRecipeIngredientToCore()

pocketmine\network\mcpe\convert\TypeConverter::netRecipeIngredientToCore ( ProtocolRecipeIngredient  $ingredient)

Definition at line 161 of file TypeConverter.php.

◆ protocolGameModeToCore()

pocketmine\network\mcpe\convert\TypeConverter::protocolGameModeToCore ( int  $gameMode)

Definition at line 123 of file TypeConverter.php.

◆ setSkinAdapter()

pocketmine\network\mcpe\convert\TypeConverter::setSkinAdapter ( SkinAdapter  $skinAdapter)

Definition at line 104 of file TypeConverter.php.

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