mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-02 05:02:10 -07:00
Add Registry#getTagValues (#12603)
This commit is contained in:
@@ -491,10 +491,27 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
||||
* @throws NoSuchElementException if no tag with the given key is found
|
||||
* @throws UnsupportedOperationException if this registry doesn't have or support tags
|
||||
* @see #hasTag(TagKey)
|
||||
* @see #getTagValues(TagKey)
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
Tag<T> getTag(TagKey<T> key);
|
||||
|
||||
/**
|
||||
* Gets the named registry set (tag) for the given key and resolves it with this registry.
|
||||
*
|
||||
* @param key the key to get the tag for
|
||||
* @return the resolved values
|
||||
* @throws NoSuchElementException if no tag with the given key is found
|
||||
* @throws UnsupportedOperationException if this registry doesn't have or support tags
|
||||
* @see #getTag(TagKey)
|
||||
* @see Tag#resolve(Registry)
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
default Collection<T> getTagValues(TagKey<T> key) {
|
||||
Tag<T> tag = getTag(key);
|
||||
return tag.resolve(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all the tags in this registry.
|
||||
*
|
||||
|
Reference in New Issue
Block a user