LegacyStringToItemParser
in package
Uses
SingletonTrait
Tags
Table of Contents
- $instance : self|null
- $itemFactory : ItemFactory
- $map : array<string|int, int>
- __construct() : mixed
- addMapping() : void
- getInstance() : self
- getMappings() : array<string|int, int>
- parse() : Item
- Tries to parse the specified string into Item types.
- reset() : void
- setInstance() : void
- reprocess() : string
- make() : self
Properties
$instance
private
static self|null
$instance
= null
$itemFactory
private
ItemFactory
$itemFactory
$map
private
array<string|int, int>
$map
= []
Tags
Methods
__construct()
public
__construct(ItemFactory $itemFactory) : mixed
Parameters
- $itemFactory : ItemFactory
Return values
mixed —addMapping()
public
addMapping(string $alias, int $id) : void
Parameters
- $alias : string
- $id : int
Return values
void —getInstance()
public
static getInstance() : self
Return values
self —getMappings()
public
getMappings() : array<string|int, int>
Tags
Return values
array<string|int, int> —parse()
Tries to parse the specified string into Item types.
public
parse(string $input) : Item
Example accepted formats:
-
diamond_pickaxe:5
-
minecraft:string
-
351:4 (lapis lazuli ID:meta)
Parameters
- $input : string
Tags
Return values
Item —reset()
public
static reset() : void
Return values
void —setInstance()
public
static setInstance(self $instance) : void
Parameters
- $instance : self
Return values
void —reprocess()
protected
reprocess(string $input) : string
Parameters
- $input : string
Return values
string —make()
private
static make() : self