PocketMine-MP 5.15.1 git-fb9a74e8799c71ed8292cfa53abe7a4c9204629d
pocketmine\item\StringToItemParser Class Reference
+ Inheritance diagram for pocketmine\item\StringToItemParser:
+ Collaboration diagram for pocketmine\item\StringToItemParser:

Public Member Functions

 getKnownAliases ()
 
 lookupAliases (Item $item)
 
 lookupBlockAliases (Block $block)
 
 override (string $alias, \Closure $callback)
 
 parse (string $input)
 
 register (string $alias, \Closure $callback)
 
 registerAlias (string $existing, string $alias)
 
 registerBlock (string $alias, \Closure $callback)
 

Protected Member Functions

 reprocess (string $input)
 

Detailed Description

Handles parsing items from strings. This is used to interpret names from the /give command (and others).

@phpstan-extends StringToTParser<Item>

Definition at line 48 of file StringToItemParser.php.

Member Function Documentation

◆ getKnownAliases()

pocketmine\utils\StringToTParser::getKnownAliases ( )
inherited
Returns
string[]|int[]

Definition at line 94 of file StringToTParser.php.

◆ lookupAliases()

pocketmine\item\StringToItemParser::lookupAliases ( Item  $item)

Returns a list of currently registered aliases that resolve to the given item.

Returns
string[] @phpstan-return list<string>

Definition at line 1540 of file StringToItemParser.php.

◆ lookupBlockAliases()

pocketmine\item\StringToItemParser::lookupBlockAliases ( Block  $block)

Returns a list of currently registered aliases that resolve to the item form of the given block.

Returns
string[] @phpstan-return list<string>

Definition at line 1551 of file StringToItemParser.php.

◆ override()

pocketmine\utils\StringToTParser::override ( string  $alias,
\Closure  $callback 
)
inherited

@phpstan-param \Closure(string $input) : T $callback

Definition at line 57 of file StringToTParser.php.

◆ parse()

pocketmine\item\StringToItemParser::parse ( string  $input)

Tries to parse the specified string into a corresponding instance of T. @phpstan-return T|null

Reimplemented from pocketmine\utils\StringToTParser.

Definition at line 1530 of file StringToItemParser.php.

◆ register()

pocketmine\item\StringToItemParser::register ( string  $alias,
\Closure  $callback 
)

@phpstan-param \Closure(string $input) : T $callback

Reimplemented from pocketmine\utils\StringToTParser.

Definition at line 1519 of file StringToItemParser.php.

◆ registerAlias()

pocketmine\utils\StringToTParser::registerAlias ( string  $existing,
string  $alias 
)
inherited

Registers a new alias for an existing known alias.

Definition at line 64 of file StringToTParser.php.

◆ registerBlock()

pocketmine\item\StringToItemParser::registerBlock ( string  $alias,
\Closure  $callback 
)

@phpstan-param \Closure(string $input) : Block $callback

Definition at line 1526 of file StringToItemParser.php.

◆ reprocess()

pocketmine\utils\StringToTParser::reprocess ( string  $input)
protectedinherited

Definition at line 89 of file StringToTParser.php.


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