PocketMine-MP 5.21.2 git-a6534ecbbbcf369264567d27e5ed70f7f5be9816
|
Public Member Functions | |
__construct (private ItemDataUpgrader $itemDataUpgrader, private ItemDeserializer $itemDeserializer) | |
addMapping (string $alias, string $id) | |
getMappings () | |
parse (string $input) | |
Protected Member Functions | |
reprocess (string $input) | |
This class replaces the functionality that used to be provided by ItemFactory::fromString(), but in a more dynamic way. Avoid using this wherever possible. Unless you need to parse item strings containing meta (e.g. "dye:4", "351:4") or item IDs (e.g. "351"), you should prefer the newer StringToItemParser, which is much more user-friendly, more flexible, and also supports registering custom aliases for any item in any state.
WARNING: This class does NOT support items added during or after PocketMine-MP 5.0.0. Use StringToItemParser for modern items.
Definition at line 56 of file LegacyStringToItemParser.php.
pocketmine\item\LegacyStringToItemParser::__construct | ( | private ItemDataUpgrader | $itemDataUpgrader, |
private ItemDeserializer | $itemDeserializer ) |
Definition at line 84 of file LegacyStringToItemParser.php.
pocketmine\item\LegacyStringToItemParser::addMapping | ( | string | $alias, |
string | $id ) |
Definition at line 89 of file LegacyStringToItemParser.php.
pocketmine\item\LegacyStringToItemParser::getMappings | ( | ) |
Definition at line 97 of file LegacyStringToItemParser.php.
pocketmine\item\LegacyStringToItemParser::parse | ( | string | $input | ) |
Tries to parse the specified string into Item types.
Example accepted formats:
diamond_pickaxe:5
minecraft:string
351:4 (lapis lazuli ID:meta)
LegacyStringToItemParserException | if the given string cannot be parsed as an item identifier |
Definition at line 111 of file LegacyStringToItemParser.php.
|
protected |
Definition at line 142 of file LegacyStringToItemParser.php.