|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.amoebaman.kitmaster.handlers.InventoryUtil
public class InventoryUtil
| Nested Class Summary | |
|---|---|
static class |
InventoryUtil.Armor
Represents a piece of armor, |
static class |
InventoryUtil.EnchantmentWithLevel
Stores both the type and level of an enchantment. |
static class |
InventoryUtil.Weapon
Represents a weapon |
| Field Summary | |
|---|---|
static java.util.HashMap<org.bukkit.Material,InventoryUtil.Armor> |
armor
Stores the Armor that corresponds to each Material. |
static java.util.HashMap<org.bukkit.Material,InventoryUtil.Weapon> |
weapons
Stores the Weapon that corresponds to each Material. |
| Constructor Summary | |
|---|---|
InventoryUtil()
|
|
| Method Summary | |
|---|---|
static void |
addItemsToInventory(org.bukkit.entity.Player player,
java.util.List<org.bukkit.inventory.ItemStack> items)
Adds a list of ItemStack to a player's inventory. |
static void |
addItemToInventory(org.bukkit.entity.Player player,
org.bukkit.inventory.ItemStack stack)
Adds an ItemStack to a player's inventory. |
static java.lang.String |
effectToString(org.bukkit.potion.PotionEffect effect)
Gets a user-friendly String that represents an PotionEffect. |
static org.bukkit.potion.PotionEffectType |
getEffectByCommonName(java.lang.String name)
Gets a PotionEffectType by it's more common name. |
static org.bukkit.enchantments.Enchantment |
getEnchantmentByCommonName(java.lang.String name)
Gets an Enchantment by it's more common name. |
static org.bukkit.Material |
getMat(java.lang.String name)
Gets a material by its enumerated name, common name, or type ID. |
static boolean |
isInt(java.lang.String str)
Tests whether a String can be safely interpreted as an int. |
static java.lang.String |
itemToString(org.bukkit.inventory.ItemStack stack)
Gets a user-friendly String that represents an ItemStack. |
static org.bukkit.potion.PotionEffect |
parseEffect(java.lang.String str)
Parses a PotionEffect from a String. |
static InventoryUtil.EnchantmentWithLevel |
parseEnchantment(java.lang.String str)
Parses an EnchantmentWithLevel from a String. |
static org.bukkit.inventory.ItemStack |
parseItem(java.lang.String str)
Parses an ItemStack from a String. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.util.HashMap<org.bukkit.Material,InventoryUtil.Armor> armor
Armor that corresponds to each Material.
public static final java.util.HashMap<org.bukkit.Material,InventoryUtil.Weapon> weapons
Weapon that corresponds to each Material.
| Constructor Detail |
|---|
public InventoryUtil()
| Method Detail |
|---|
public static org.bukkit.enchantments.Enchantment getEnchantmentByCommonName(java.lang.String name)
Enchantment by it's more common name.
name - The common name of the desired enchantment.
public static org.bukkit.potion.PotionEffectType getEffectByCommonName(java.lang.String name)
PotionEffectType by it's more common name.
name - The common name of the desired effect.
public static void addItemsToInventory(org.bukkit.entity.Player player,
java.util.List<org.bukkit.inventory.ItemStack> items)
ItemStack to a player's inventory.
player - The player to give the items to.items - The items to give.
public static void addItemToInventory(org.bukkit.entity.Player player,
org.bukkit.inventory.ItemStack stack)
ItemStack to a player's inventory.
player - The player to give the item to.items - The item to give.
public static org.bukkit.inventory.ItemStack parseItem(java.lang.String str)
throws ParseItemException
ItemStack from a String.
str - The String to parse from.
ParseItemException - If str is not formatted properly.
public static org.bukkit.potion.PotionEffect parseEffect(java.lang.String str)
throws ParseItemException
PotionEffect from a String.
str - The String to parse from.
ParseItemException - If str is not formatted properly.public static InventoryUtil.EnchantmentWithLevel parseEnchantment(java.lang.String str)
EnchantmentWithLevel from a String.
str - The String to parse from.
public static org.bukkit.Material getMat(java.lang.String name)
name - The name to search for.
public static java.lang.String itemToString(org.bukkit.inventory.ItemStack stack)
ItemStack.
stack - The item to read.
public static java.lang.String effectToString(org.bukkit.potion.PotionEffect effect)
PotionEffect.
stack - The effect to read.
public static boolean isInt(java.lang.String str)
str - The string to test.
Integer.parseInt(String) can be safely used on str, false otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||