StringToItemParser
extends StringToTParser
in package
Uses
SingletonTrait
Handles parsing items from strings. This is used to interpret names from the /give command (and others).
Tags
Table of Contents
- $callbackMap : array<string|int, mixed>
- $instance : self|null
- getInstance() : self
- getKnownAliases() : array<string|int, string>|array<string|int, int>
- override() : void
- parse() : Item|null
- Tries to parse the specified string into an enchantment.
- register() : void
- registerBlock() : void
- reset() : void
- setInstance() : void
- reprocess() : string
- make() : self
Properties
$callbackMap
private
array<string|int, mixed>
$callbackMap
= []
Tags
$instance
private
static self|null
$instance
= null
Methods
getInstance()
public
static getInstance() : self
Return values
self —getKnownAliases()
public
getKnownAliases() : array<string|int, string>|array<string|int, int>
Return values
array<string|int, string>|array<string|int, int> —override()
public
override(string $alias, Closure $callback) : void
Parameters
- $alias : string
- $callback : Closure
Tags
Return values
void —parse()
Tries to parse the specified string into an enchantment.
public
parse(string $input) : Item|null
Parameters
- $input : string
Return values
Item|null —register()
public
register(string $alias, Closure $callback) : void
Parameters
- $alias : string
- $callback : Closure
Tags
Return values
void —registerBlock()
public
registerBlock(string $alias, Closure $callback) : void
Parameters
- $alias : string
- $callback : Closure
Tags
Return values
void —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