Package be.seeseemelk.mockbukkit.tags
Class TagParser
java.lang.Object
be.seeseemelk.mockbukkit.tags.TagParser
- All Implemented Interfaces:
net.kyori.adventure.key.Keyed
,Keyed
The
TagParser
is responsible for parsing a JSON input into a TagWrapperMock
.-
Constructor Summary
ConstructorsConstructorDescriptionTagParser
(@NotNull TagRegistry registry, @NotNull NamespacedKey key) This constructs a newTagParser
. -
Method Summary
Modifier and TypeMethodDescription@NotNull NamespacedKey
getKey()
void
parse
(@NotNull String json, @NotNull BiConsumer<Set<Material>, Set<TagWrapperMock>> callback)
-
Constructor Details
-
TagParser
This constructs a newTagParser
.- Parameters:
registry
- TheTagRegistry
for the resultingTag
key
- TheNamespacedKey
of the resultingTag
-
-
Method Details
-
parse
public void parse(@NotNull @NotNull String json, @NotNull @NotNull BiConsumer<Set<Material>, Set<TagWrapperMock>> callback) throws TagMisconfigurationExceptionThis will parse the given JSONString
and run the provided callback withSets
of matchedMaterials
andTags
.- Parameters:
json
- The JSONString
to parsecallback
- A callback to run after successfully parsing the input- Throws:
TagMisconfigurationException
- This is thrown whenever the given input is malformed or no adequateMaterial
orTag
could be found
-
getKey
-