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 NamespacedKeygetKey()voidparse(@NotNull String json, @NotNull BiConsumer<Set<Material>, Set<TagWrapperMock>> callback)
-
Constructor Details
-
TagParser
This constructs a newTagParser.- Parameters:
registry- TheTagRegistryfor the resultingTagkey- TheNamespacedKeyof 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 JSONStringand run the provided callback withSetsof matchedMaterialsandTags.- Parameters:
json- The JSONStringto parsecallback- A callback to run after successfully parsing the input- Throws:
TagMisconfigurationException- This is thrown whenever the given input is malformed or no adequateMaterialorTagcould be found
-
getKey
-