diff --git a/pom.xml b/pom.xml index 9f4b632..3b8aa10 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ me.pikamug.localelib LocaleLib - 2.5 + 2.6 UTF-8 diff --git a/src/main/java/me/pikamug/localelib/LocaleManager.java b/src/main/java/me/pikamug/localelib/LocaleManager.java index 03db5e7..ca550ac 100644 --- a/src/main/java/me/pikamug/localelib/LocaleManager.java +++ b/src/main/java/me/pikamug/localelib/LocaleManager.java @@ -250,6 +250,18 @@ public boolean sendMessage(final Player player, final String message, final Enti Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "tellraw " + player.getName() + " [\"" + msg + "\"]"); return true; } + + /** + * Gets the key name of the specified item as it would appear in a Minecraft lang file. + * + * @param itemStack the item to check + * @return the raw key + * @throws IllegalArgumentException if that item could not be found + */ + @SuppressWarnings("deprecation") + public String queryItemStack(final ItemStack itemStack) { + return queryMaterial(itemStack.getType(), itemStack.getDurability(), itemStack.getItemMeta()); + } /** * Gets the key name of the specified material as it would appear in a Minecraft lang file. @@ -267,6 +279,7 @@ public String queryMaterial(final Material material) throws IllegalArgumentExcep * * @param material the material to check * @param durability the material type to check + * @param meta the item meta data to check * @return the raw key * @throws IllegalArgumentException if an item with that material and durability could not be found * @throws NullArgumentException if the specified material parameter is null diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 6234ae0..23316b1 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: LocaleLib main: me.pikamug.localelib.LocaleLib -version: 2.5 +version: 2.6 api-version: 1.13 description: Show translated names of items, entities & more in client's language website: https://github.com/PikaMug/LocaleLib