StringToEffectParser
extends StringToTParser
in package
Uses
SingletonTrait
Handles parsing effect types from strings. This is used to interpret names in the /effect command.
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() : Effect|null
- Tries to parse the specified string into an enchantment.
- register() : 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) : Effect|null
Parameters
- $input : string
Return values
Effect|null —register()
public
register(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