Enum Class TagOrigin
- All Implemented Interfaces:
Serializable
,Comparable<TagOrigin>
,Constable
The origin of a tag, eg. from Bukkit, from Paper, from a custom Skript tag, or from anywhere.
Used for classification and filtering tags.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic TagOrigin
fromParseTags
(@NotNull Collection<String> tags) Determines the origin of tags based on the parse tags provided.static @NotNull String
Returns an optional choice of all the origins (minecraft, datapack, paper, and custom).boolean
Checks if the current TagOrigin matches another TagOrigin, considering ANY as a wildcard.@NotNull String
toString
(boolean datapackOnly) Returns a string for use inDebuggable.toString(Event, boolean)
methods.static TagOrigin
Returns the enum constant of this class with the specified name.static TagOrigin[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BUKKIT
Bukkit supplies both native minecraft tags and datapack tags. -
PAPER
Paper supplies a set of custom tags they curate. -
SKRIPT
Custom tags registered via Skript. -
ANY
Used when asking for tags, matches all origins.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
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
. ReturnsTagOrigin.ANY
if no specific origin is found. - See Also:
-
matches
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 isANY
).
-
toString
Returns a string for use inDebuggable.toString(Event, boolean)
methods.- Parameters:
datapackOnly
- Whether to output "datapack " or "minecraft " forBUKKIT
.- Returns:
- a string representing the origin, with a trailing space.
-