public class ScriptableItemStack
extends java.lang.Object
Constructor and Description |
---|
ScriptableItemStack(net.minecraft.item.ItemStack stack) |
Modifier and Type | Method and Description |
---|---|
void |
addEnchantment(int id,
int level)
Adds an enchantment to the itemstack
|
boolean |
canEfficientlyBreak(int blockId,
int metadata)
Checks if the itemstack can efficiently break the given block.
|
boolean |
canHarvest(int blockId,
int metadata)
Checks if the itemstack can harvest the given block.
|
void |
clearEnchantments()
Removes all enchantments from the itemstack
|
void |
damageItem(int amount)
Damages the item by the given amount
|
int |
getDamage()
Gets the stack's damage value
|
float |
getFloatData(java.lang.String name)
Gets the stack's float data
|
int |
getId()
Gets the stack's itemID
|
int |
getIntData(java.lang.String name)
Gets the stack's int data
|
int |
getMaxStackSize()
Gets the stack's maximum stack size
|
int |
getStackSize()
Gets the stack's stack size
|
java.lang.String |
getStringData(java.lang.String name)
Gets the stack's string data
|
boolean |
hasEnchantment()
Checks if the itemstack has any enchantment
|
boolean |
hasEnchantment(int id)
Checks if the itemstack has the given enchantment
|
boolean |
hasEnchantment(int id,
int level)
Checks if the itemstack has the given enchantment.
|
void |
removeEnchantment(int id)
Removes an enchantment from the itemstack
|
void |
setDamage(int damage)
Sets the stack's damage value
|
void |
setFloatData(java.lang.String name,
float data)
Sets the stack's float data
|
void |
setId(int id)
Sets the stack's itemID
|
void |
setIntData(java.lang.String name,
int data)
Sets the stack's int data
|
void |
setStackSize(int stackSize)
Sets the stack's stack size
|
void |
setStringData(java.lang.String name,
java.lang.String data)
Sets the stack's string data
|
void |
setValues(int id,
int stacksize,
int meta)
Sets the stack's itemID, damage value and stack size
|
public ScriptableItemStack(net.minecraft.item.ItemStack stack)
public void setValues(int id, int stacksize, int meta)
id
- The new itemIDstacksize
- The new stack sizemeta
- The new damage valuepublic void setId(int id)
id
- The new itemIDpublic int getId()
public void setDamage(int damage)
damage
- The new damage valuepublic int getDamage()
public void setStackSize(int stackSize)
stackSize
- The new stack sizepublic int getStackSize()
public int getMaxStackSize()
public void damageItem(int amount)
amount
- The damage to add to the itempublic boolean hasEnchantment()
public boolean hasEnchantment(int id)
id
- The id of the enchantmentpublic boolean hasEnchantment(int id, int level)
id
- The id of the enchantmentlevel
- The level of the enchantmentpublic void clearEnchantments()
public void addEnchantment(int id, int level)
id
- The id of the enchantmentlevel
- The level of the enchantmentpublic void removeEnchantment(int id)
id
- The id of the enchantmentpublic int getIntData(java.lang.String name)
name
- The data's namepublic float getFloatData(java.lang.String name)
name
- The data's namepublic java.lang.String getStringData(java.lang.String name)
name
- The data's namepublic void setIntData(java.lang.String name, int data)
name
- The data's namedata
- The datapublic void setFloatData(java.lang.String name, float data)
name
- The data's namedata
- The datapublic void setStringData(java.lang.String name, java.lang.String data)
name
- The data's namedata
- The datapublic boolean canEfficientlyBreak(int blockId, int metadata)
blockId
- The block's idmetadata
- The block's metadatapublic boolean canHarvest(int blockId, int metadata)
blockId
- The block's idmetadata
- The block's metadata