WookieeItemNames
WookieeItemNames
A library for item names and enchants. Editable config for locale or customname.
Allows you to get the names for items and enchants that you see in the client rather than the bukkit internal names. Such as Aqua Affinity instead of WATER_WORKER, or Wooden Shovel instead of WOOD_SPADE.
These names are stored in the config.yml so you can change them to match your locale or fit with renamed items on your server.
Usage
- getEnchantName(String enchantment)
- Returns a string from the config file that matches the enchantment string gotten by Enchantment.getName()
- getEnchantName(Enchantment enchantment)
- Returns a string from the config file that matches the Enchantment object
- getItemName(String itemname, int datavalue, boolean plural)
- Returns a string from the config file that matches the itemname string. Returns the plural name if the boolean plural is true.
- getItemName(int itemid, int datavalue, boolean plural)
- Returns a string from the config file that matches the itemid int. Returns the plural name if the boolean plural is true.
- getItemName(Material material, int datavalue, boolean plural)
- Returns a string from the config file that matches the Material object. Returns the plural name if the boolean plural is true.
Commands
None. No commands planned to be added.
Permissions
None. No permissions planned to be added.
API javadoc
http://chieloos.co.uk/wookieeitemnames/0.3/javadoc/
Source
https://github.com/chieloos/WookieeItemNames
Features to come
- Abreviated item and enchant names.
Changelog
0.3
- Changed getItemName to accept a boolean plural to get the plural name of an item
0.2
- Added getEnchantName from Enchantment object.
- Added getItemName from Material object.
-
View User Profile
-
Send Message
Posted Mar 29, 2013@RafaSKB
Thanks for the suggestion, I'll be adding this to the next release.
-
View User Profile
-
Send Message
Posted Mar 28, 2013I made a library like this for my plugins, and a good suggestion is to add a method to get the item's plural name =) It's pretty useful when dealing with amounts, to build a natural sentence.
Good luck :)
-
View User Profile
-
Send Message
Posted Mar 28, 2013@Colin969
I feel getEnchantFromName would be misleading as it sounds like you would be getting an Enchantment object from an enchant name, where as you are getting a string from the config.yml which has stored names similar to what you would find inside the client rather than the internal names.
I have added to getEnchantName, so that you can pass an Enchantment object though, and updated the description to hopefully make it clearer.
-
View User Profile
-
Send Message
Posted Mar 27, 2013If your getting the enchant name, then it should be passed an Enchanment, not a String. If you are passing a string, it should be getEnchantFromName instead.