minny.zephyrus.utils
Class ItemUtil

java.lang.Object
  extended by minny.zephyrus.utils.ItemUtil
Direct Known Subclasses:
CustomItem, PlayerListener, SpellTome

public class ItemUtil
extends java.lang.Object

Zephyrus

Author:
minnymin3

Field Summary
 Zephyrus plugin
           
 
Constructor Summary
ItemUtil(Zephyrus plugin)
           
 
Method Summary
 boolean checkName(org.bukkit.inventory.ItemStack i, java.lang.String name)
          Check if the name of the ItemStack is the same as the string provided
 void delay(java.util.Map<java.lang.String,java.lang.Object> map, Zephyrus plugin, int delay, java.lang.String name)
          Sets the ItemDelay (see BlinkPearl)
static int delayFromLevel(int level)
          Gets the tick delay from a level
 java.lang.String enchantLevel(int level)
          Gets the roman numeral for Enchantments from an integer
 int getItemLevel(org.bukkit.inventory.ItemStack i)
          Gets the level of the item (defined in the lore)
 void setCustomEnchantment(org.bukkit.inventory.ItemStack item, org.bukkit.enchantments.Enchantment enchant, int level)
          Used for custom enchantments and displaying their names
 void setGlow(org.bukkit.inventory.ItemStack item)
          Sets a dummy enchantment on the item making it glow
 org.bukkit.inventory.ItemStack setItemLevel(org.bukkit.inventory.ItemStack i, int level)
          Used for custom items, it sets the item level
 void setItemName(org.bukkit.inventory.ItemStack item, java.lang.String name)
          Set the name for the item
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

plugin

public Zephyrus plugin
Constructor Detail

ItemUtil

public ItemUtil(Zephyrus plugin)
Method Detail

setItemName

public void setItemName(org.bukkit.inventory.ItemStack item,
                        java.lang.String name)
Set the name for the item

Parameters:
item - The ItemStack to rename
name - The name of the ItemStack

setGlow

public void setGlow(org.bukkit.inventory.ItemStack item)
Sets a dummy enchantment on the item making it glow

Parameters:
item - The ItemStack to add the enchantment effect to

setCustomEnchantment

public void setCustomEnchantment(org.bukkit.inventory.ItemStack item,
                                 org.bukkit.enchantments.Enchantment enchant,
                                 int level)
Used for custom enchantments and displaying their names

Parameters:
item - The ItemStack for the Enchantment
enchant - The Enchantment
level - The level of the Enchantment

enchantLevel

public java.lang.String enchantLevel(int level)
Gets the roman numeral for Enchantments from an integer

Parameters:
level - The integer to convert
Returns:
The equivalent roman numeral

setItemLevel

public org.bukkit.inventory.ItemStack setItemLevel(org.bukkit.inventory.ItemStack i,
                                                   int level)
Used for custom items, it sets the item level

Parameters:
i - The target ItemStack
level - The target level
Returns:
An ItemStack with the custom level

checkName

public boolean checkName(org.bukkit.inventory.ItemStack i,
                         java.lang.String name)
Check if the name of the ItemStack is the same as the string provided

Parameters:
i - The ItemStack to check
name - The name to check
Returns:
True if the display name of the item is the same as the string

getItemLevel

public int getItemLevel(org.bukkit.inventory.ItemStack i)
Gets the level of the item (defined in the lore)

Parameters:
i - The target ItemStack
Returns:
The level of the item

delay

public void delay(java.util.Map<java.lang.String,java.lang.Object> map,
                  Zephyrus plugin,
                  int delay,
                  java.lang.String name)
Sets the ItemDelay (see BlinkPearl)

Parameters:
map - The Map to add the player to
plugin - Zephyrus
delay - The time, in ticks, of the delay
name - The name of the player

delayFromLevel

public static int delayFromLevel(int level)
Gets the tick delay from a level

Parameters:
level - A level from an item
Returns:
The tick delay from the integer. Anything above 10 will return 0