Class TagParser

java.lang.Object
be.seeseemelk.mockbukkit.tags.TagParser
All Implemented Interfaces:
net.kyori.adventure.key.Keyed, org.bukkit.Keyed

public class TagParser extends Object implements org.bukkit.Keyed
The TagParser is responsible for parsing a JSON input into a TagWrapperMock.
  • Constructor Details

    • TagParser

      public TagParser(@NotNull @NotNull TagRegistry registry, @NotNull @NotNull org.bukkit.NamespacedKey key)
      This constructs a new TagParser.
      Parameters:
      registry - The TagRegistry for the resulting Tag
      key - The NamespacedKey of the resulting Tag
  • Method Details

    • parse

      public void parse(@NotNull @NotNull String json, @NotNull @NotNull BiConsumer<Set<org.bukkit.Material>,Set<TagWrapperMock>> callback) throws TagMisconfigurationException
      This will parse the given JSON String and run the provided callback with Sets of matched Materials and Tags.
      Parameters:
      json - The JSON String to parse
      callback - A callback to run after successfully parsing the input
      Throws:
      TagMisconfigurationException - This is thrown whenever the given input is malformed or no adequate Material or Tag could be found
    • getKey

      @NotNull public @NotNull org.bukkit.NamespacedKey getKey()
      Specified by:
      getKey in interface org.bukkit.Keyed