Enum Class TagOrigin

java.lang.Object
java.lang.Enum<TagOrigin>
org.skriptlang.skript.bukkit.tags.sources.TagOrigin
All Implemented Interfaces:
Serializable, Comparable<TagOrigin>, Constable

public enum TagOrigin extends Enum<TagOrigin>
The origin of a tag, eg. from Bukkit, from Paper, from a custom Skript tag, or from anywhere. Used for classification and filtering tags.
  • Enum Constant Details

    • BUKKIT

      public static final TagOrigin BUKKIT
      Bukkit supplies both native minecraft tags and datapack tags.
    • PAPER

      public static final TagOrigin PAPER
      Paper supplies a set of custom tags they curate.
    • SKRIPT

      public static final TagOrigin SKRIPT
      Custom tags registered via Skript.
    • ANY

      public static final TagOrigin ANY
      Used when asking for tags, matches all origins.
  • Method Details

    • values

      public static TagOrigin[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TagOrigin valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getFullPattern

      @Contract(pure=true) @NotNull public static @NotNull String getFullPattern()
      Returns an optional choice of all the origins (minecraft, datapack, paper, and custom). Will not include paper on non-paper servers. Contains parse tags.
      See Also:
    • fromParseTags

      @Contract(value="_ -> new", pure=true) public static TagOrigin fromParseTags(@NotNull @NotNull Collection<String> tags)
      Determines the origin of tags based on the parse tags provided.
      Parameters:
      tags - the list of tags to parse for determining the origin.
      Returns:
      the determined TagOrigin. Returns TagOrigin.ANY if no specific origin is found.
      See Also:
    • matches

      public boolean matches(TagOrigin other)
      Checks if the current TagOrigin matches another TagOrigin, considering ANY as a wildcard.
      Parameters:
      other - The other TagOrigin to be matched against.
      Returns:
      true if the TagOrigins match (i.e., they are the same, or either is ANY).
    • toString

      @Contract(pure=true) @NotNull public @NotNull String toString(boolean datapackOnly)
      Returns a string for use in Debuggable.toString(Event, boolean) methods.
      Parameters:
      datapackOnly - Whether to output "datapack " or "minecraft " for BUKKIT.
      Returns:
      a string representing the origin, with a trailing space.