com.quartercode.quarterbukkit.api
Class ItemData

java.lang.Object
  extended by com.quartercode.quarterbukkit.api.ItemData

public class ItemData
extends java.lang.Object


Constructor Summary
ItemData()
          Creates a new empty item data object.
ItemData(org.bukkit.block.Block block)
          Creates a new item data object and fills it with the data of a Block.
ItemData(org.bukkit.inventory.ItemStack itemStack)
          Creates a new item data object and fills it with the data of an ItemStack.
ItemData(org.bukkit.Material material)
          Creates a new item data object and fills it with a Material.
ItemData(org.bukkit.Material material, byte data)
          Creates a new item data object and fills it with a Material and a data value.
 
Method Summary
 void apply(org.bukkit.block.Block block)
          Applys the data of this item data object to an Block.
 void apply(org.bukkit.inventory.ItemStack itemStack)
          Applys the data of this item data object to an ItemStack.
 boolean contains(org.bukkit.inventory.Inventory inventory)
          Returns if the given Inventory contains at least one ItemStack with the data of this item data object.
 boolean containsAtLeast(org.bukkit.inventory.Inventory inventory, int minimumAmount)
          Returns if the given Inventory contains at least the given amount of ItemStacks with the data of this item data object.
 boolean equals(org.bukkit.block.Block block)
          Returns if the data of this item data object equals the data from an Block.
static boolean equals(org.bukkit.block.Block block1, org.bukkit.block.Block block2)
          Checks if two Blocks are the same.
 boolean equals(ItemData itemData)
          Returns if this item data object equals another.
 boolean equals(org.bukkit.inventory.ItemStack itemStack)
          Returns if the data of this item data object equals the data from an ItemStack.
static boolean equals(org.bukkit.inventory.ItemStack itemStack1, org.bukkit.block.Block block2)
          Checks if the datas of an ItemStack and a Block are the same.
static boolean equals(org.bukkit.inventory.ItemStack itemStack1, org.bukkit.inventory.ItemStack itemStack2)
          Checks if two ItemStacks are the same.
 boolean equals(java.lang.Object object)
           
 byte getData()
          Returns the data value of the item data object.
 org.bukkit.Material getMaterial()
          Returns the Material of the item data object.
 void setData(byte data)
          Sets the data value of the item data object.
 void setMaterial(org.bukkit.Material material)
          Sets the Material of the item data object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ItemData

public ItemData()
Creates a new empty item data object.


ItemData

public ItemData(org.bukkit.Material material)
Creates a new item data object and fills it with a Material.

Parameters:
material - The Material.

ItemData

public ItemData(org.bukkit.Material material,
                byte data)
Creates a new item data object and fills it with a Material and a data value.

Parameters:
material - The Material.
data - The data value.

ItemData

public ItemData(org.bukkit.inventory.ItemStack itemStack)
Creates a new item data object and fills it with the data of an ItemStack.

Parameters:
itemStack - The ItemStack to read the data from.

ItemData

public ItemData(org.bukkit.block.Block block)
Creates a new item data object and fills it with the data of a Block.

Parameters:
block - The Block to read the data from.
Method Detail

equals

public static boolean equals(org.bukkit.inventory.ItemStack itemStack1,
                             org.bukkit.inventory.ItemStack itemStack2)
Checks if two ItemStacks are the same.

Parameters:
itemStack1 - The first ItemStack.
itemStack2 - The second ItemStack.
Returns:
If both ItemStacks are the same.

equals

public static boolean equals(org.bukkit.block.Block block1,
                             org.bukkit.block.Block block2)
Checks if two Blocks are the same.

Parameters:
block1 - The first Block.
block2 - The second Block.
Returns:
If both Blocks are the same.

equals

public static boolean equals(org.bukkit.inventory.ItemStack itemStack1,
                             org.bukkit.block.Block block2)
Checks if the datas of an ItemStack and a Block are the same.

Parameters:
itemStack1 - The first ItemStack.
block2 - The second Block.
Returns:
If the datas of the ItemStack and the Block are the same.

getMaterial

public org.bukkit.Material getMaterial()
Returns the Material of the item data object.

Returns:
The Material of the item data object.

setMaterial

public void setMaterial(org.bukkit.Material material)
Sets the Material of the item data object.

Parameters:
material - The new Material of the item data object.

getData

public byte getData()
Returns the data value of the item data object.

Returns:
The data value of the item data object.

setData

public void setData(byte data)
Sets the data value of the item data object.

Parameters:
data - The new data value of the item data object.

equals

public boolean equals(ItemData itemData)
Returns if this item data object equals another.

Parameters:
itemData - The item data object to compare with.
Returns:
If this item data object equals the other one.

equals

public boolean equals(org.bukkit.inventory.ItemStack itemStack)
Returns if the data of this item data object equals the data from an ItemStack.

Parameters:
itemStack - The ItemStack to compare with.
Returns:
If the data of this item data object equals the data from the ItemStack.

equals

public boolean equals(org.bukkit.block.Block block)
Returns if the data of this item data object equals the data from an Block.

Parameters:
block - The Block to compare with.
Returns:
If the data of this item data object equals the data from the Block.

contains

public boolean contains(org.bukkit.inventory.Inventory inventory)
Returns if the given Inventory contains at least one ItemStack with the data of this item data object.

Parameters:
inventory - The Inventory to check.
Returns:
If the given Inventory contains at least one ItemStack with the data of this item data object.

containsAtLeast

public boolean containsAtLeast(org.bukkit.inventory.Inventory inventory,
                               int minimumAmount)
Returns if the given Inventory contains at least the given amount of ItemStacks with the data of this item data object.

Parameters:
inventory - The Inventory to check.
minimumAmount - The minimum count of item stacks.
Returns:
If the given Inventory contains at least the given amount of ItemStacks with the data of this item data object.

apply

public void apply(org.bukkit.inventory.ItemStack itemStack)
Applys the data of this item data object to an ItemStack.

Parameters:
itemStack - The ItemStack to apply the data.

apply

public void apply(org.bukkit.block.Block block)
Applys the data of this item data object to an Block.

Parameters:
block - The Block to apply the data.

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object