Package be.seeseemelk.mockbukkit.tags
Class TagParser
java.lang.Object
be.seeseemelk.mockbukkit.tags.TagParser
- All Implemented Interfaces:
net.kyori.adventure.key.Keyed,org.bukkit.Keyed
The
TagParser is responsible for parsing a JSON input into a TagWrapperMock.-
Constructor Summary
ConstructorsConstructorDescriptionTagParser(@NotNull TagRegistry registry, @NotNull org.bukkit.NamespacedKey key) This constructs a newTagParser. -
Method Summary
Modifier and TypeMethodDescription@NotNull org.bukkit.NamespacedKeygetKey()voidparse(@NotNull String json, @NotNull BiConsumer<Set<org.bukkit.Material>, Set<TagWrapperMock>> callback) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bukkit.Keyed
key
-
Constructor Details
-
TagParser
public TagParser(@NotNull @NotNull TagRegistry registry, @NotNull @NotNull org.bukkit.NamespacedKey key) 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<org.bukkit.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
@NotNull public @NotNull org.bukkit.NamespacedKey getKey()- Specified by:
getKeyin interfaceorg.bukkit.Keyed
-