Added a method to get a list of tags

By: Matthew Miller <mnmiller1@me.com>
This commit is contained in:
Bukkit/Spigot 2019-02-17 12:59:39 +10:00
parent 1c79fa6a3f
commit 15757b3892
2 changed files with 32 additions and 0 deletions

View File

@ -1374,6 +1374,23 @@ public final class Bukkit {
return server.getTag(registry, tag, clazz);
}
/**
* Gets a all tags which have been defined within the server.
* <br>
* Server implementations are allowed to handle only the registries
* indicated in {@link Tag}.
* <br>
* No guarantees are made about the mutability of the returned iterator.
*
* @param <T> type of the tag
* @param registry the tag registry to look at
* @param clazz the class of the tag entries
* @return all defined tags
*/
public static <T extends Keyed> Iterable<Tag<T>> getTags(String registry, Class<T> clazz) {
return server.getTags(registry, clazz);
}
/**
* Gets the specified {@link LootTable}.
*

View File

@ -1145,6 +1145,21 @@ public interface Server extends PluginMessageRecipient {
*/
<T extends Keyed> Tag<T> getTag(String registry, NamespacedKey tag, Class<T> clazz);
/**
* Gets a all tags which have been defined within the server.
* <br>
* Server implementations are allowed to handle only the registries
* indicated in {@link Tag}.
* <br>
* No guarantees are made about the mutability of the returned iterator.
*
* @param <T> type of the tag
* @param registry the tag registry to look at
* @param clazz the class of the tag entries
* @return all defined tags
*/
<T extends Keyed> Iterable<Tag<T>> getTags(String registry, Class<T> clazz);
/**
* Gets the specified {@link LootTable}.
*