Class TagRegistry
java.lang.Object
org.skriptlang.skript.bukkit.tags.TagRegistry
A class in charge of storing and handling all the tags Skript can access.
-
Method Summary
Modifier and TypeMethodDescription<T extends org.bukkit.Keyed>
Iterable<org.bukkit.Tag<T>> getMatchingTags(TagOrigin origin, TagType<T> type, Predicate<org.bukkit.Tag<T>> predicate) Gets all the tags of a specific origin that are of a specific type.<T extends org.bukkit.Keyed>
@Nullable org.bukkit.Tag<T> Gets a specific tag of a specific origin that is of a specific type.<T extends org.bukkit.Keyed>
Iterable<org.bukkit.Tag<T>> Gets all the tags of a specific origin that are applicable to a given class.<T extends org.bukkit.Keyed>
Iterable<org.bukkit.Tag<T>> Gets all the tags of a specific origin that are of a specific type.
-
Method Details
-
getTags
public <T extends org.bukkit.Keyed> Iterable<org.bukkit.Tag<T>> getTags(TagOrigin origin, Class<T> typeClass, TagType<?>... types) Gets all the tags of a specific origin that are applicable to a given class.- Type Parameters:
T- see typeClass.- Parameters:
origin- The origin to filter by.typeClass- The class the tags should be applicable to.types- Tag types to check with. Leaving this empty will check all tag types.- Returns:
- TagRegistry from the given origin and types that apply to the given class.
-
getTags
public <T extends org.bukkit.Keyed> Iterable<org.bukkit.Tag<T>> getTags(TagOrigin origin, TagType<T> type) Gets all the tags of a specific origin that are of a specific type.- Type Parameters:
T- The class these tags apply to.- Parameters:
origin- The origin to filter by.type- The type of tags to get.- Returns:
- TagRegistry from the given origin that are of the given type.
-
getMatchingTags
public <T extends org.bukkit.Keyed> Iterable<org.bukkit.Tag<T>> getMatchingTags(TagOrigin origin, TagType<T> type, Predicate<org.bukkit.Tag<T>> predicate) Gets all the tags of a specific origin that are of a specific type. Filters the resulting tags using the given predicate.- Type Parameters:
T- The class these tags apply to.- Parameters:
origin- The origin to filter by.type- The type of tags to get.predicate- A predicate to filter the tags with.- Returns:
- TagRegistry from the given origin that are of the given type and that pass the filter.
-
getTag
@Nullable public <T extends org.bukkit.Keyed> @Nullable org.bukkit.Tag<T> getTag(TagOrigin origin, TagType<T> type, org.bukkit.NamespacedKey key) Gets a specific tag of a specific origin that is of a specific type.- Type Parameters:
T- The class these tags apply to.- Parameters:
origin- The origin to filter by.type- The type of tags to get.key- The key of the tag to get.- Returns:
- The tag that matched the above values. Null if no tag is found.
-