diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index ba8fd38926..0e1fc8fc09 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1868,6 +1868,25 @@ public final class CraftServer implements Server { } } + @Override + @SuppressWarnings("unchecked") + public Iterable> getTags(String registry, Class clazz) { + switch (registry) { + case org.bukkit.Tag.REGISTRY_BLOCKS: + Preconditions.checkArgument(clazz == org.bukkit.Material.class, "Block namespace must have material type"); + + TagsServer blockTags = console.getTagRegistry().a(); // PAIL: getBlockTags + return blockTags.c().keySet().stream().map(key -> (org.bukkit.Tag) new CraftBlockTag(blockTags, key)).collect(ImmutableList.toImmutableList()); + case org.bukkit.Tag.REGISTRY_ITEMS: + Preconditions.checkArgument(clazz == org.bukkit.Material.class, "Item namespace must have material type"); + + TagsServer itemTags = console.getTagRegistry().b(); // PAIL: getItemTags + return itemTags.c().keySet().stream().map(key -> (org.bukkit.Tag) new CraftItemTag(itemTags, key)).collect(ImmutableList.toImmutableList()); + default: + throw new IllegalArgumentException(); + } + } + public LootTable getLootTable(NamespacedKey key) { Validate.notNull(key, "NamespacedKey cannot be null");