Interface PlaceholderParser
- All Superinterfaces:
DefaultedRegistryValue
@CatalogedBy(PlaceholderParsers.class)
public interface PlaceholderParser
extends DefaultedRegistryValue
Provides the logic of how to parse a placeholder token.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic PlaceholderParser.Builder
builder()
Returns aPlaceholderParser.Builder
that allows for the creation of simplePlaceholderParser
s.parse
(PlaceholderContext placeholderContext) Creates aComponent
based on the providedPlaceholderContext
.Methods inherited from interface org.spongepowered.api.registry.DefaultedRegistryValue
asDefaultedReference, findKey, key
-
Method Details
-
builder
Returns aPlaceholderParser.Builder
that allows for the creation of simplePlaceholderParser
s.- Returns:
- The
PlaceholderParser.Builder
-
parse
Creates aComponent
based on the providedPlaceholderContext
.This method should not throw an error, instead returning
Component.empty()
if the suppliedPlaceholderContext
is not valid.- Parameters:
placeholderContext
- ThePlaceholderContext
- Returns:
- The
Component
-