mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 09:17:36 +01:00
Added a method to get a list of tags
By: Matthew Miller <mnmiller1@me.com>
This commit is contained in:
parent
1c79fa6a3f
commit
15757b3892
@ -1374,6 +1374,23 @@ public final class Bukkit {
|
|||||||
return server.getTag(registry, tag, clazz);
|
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}.
|
* Gets the specified {@link LootTable}.
|
||||||
*
|
*
|
||||||
|
@ -1145,6 +1145,21 @@ public interface Server extends PluginMessageRecipient {
|
|||||||
*/
|
*/
|
||||||
<T extends Keyed> Tag<T> getTag(String registry, NamespacedKey tag, Class<T> clazz);
|
<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}.
|
* Gets the specified {@link LootTable}.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user