Class Tag<T,D>
java.lang.Object
com.github.darksoulq.abyssallib.world.data.tag.Tag<T,D>
- Type Parameters:
T- The type of entries stored within the tag.D- The type of input used for testing membership in the tag.
An abstract representation of a data tag, which functions as a named collection of values.
Tags are used to group objects (like items or blocks) together under a single identifier, allowing for easier logic checks and data-driven configurations. Tags can also include other tags of the same type to form hierarchical relationships.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a direct entry to this tag.abstract booleanChecks if the given input is considered a member of this tag.getAll()Retrieves a flattened set of all entries in this tag and all inherited tags.net.kyori.adventure.key.KeygetId()Retrieves the unique identifier representing this tag.Retrieves the set of tags directly included by this tag.getType()Retrieves the specific type of this tag.Retrieves the local set of values directly assigned to this tag.voidIncludes another tag's contents into this tag.
-
Constructor Details
-
Tag
public Tag(net.kyori.adventure.key.Key id) Constructs a new Tag instance.- Parameters:
id- The identifier for this tag.
-
-
Method Details
-
getType
-
add
Adds a direct entry to this tag.- Parameters:
value- The value of typeTto add.
-
include
-
contains
Checks if the given input is considered a member of this tag.- Parameters:
input- The input of typeDto test.- Returns:
trueif the input matches any value in this tag or its included tags.
-
getAll
-
getValues
-
getIncluded
-
getId
public net.kyori.adventure.key.Key getId()Retrieves the unique identifier representing this tag.- Returns:
- The
Keyidentifier.
-