public class ScriptableInventory
extends java.lang.Object
| Constructor and Description |
|---|
ScriptableInventory(net.minecraft.inventory.IInventory inventory) |
| Modifier and Type | Method and Description |
|---|---|
int |
add(java.lang.String itemName,
int count,
int metadata)
Add items the the inventory.
|
void |
addEnchantment(int slotId,
int id,
int level)
Add a certain enchantment to the item in a slot.
|
int |
addToSlot(int slotId,
int count)
Add the given amount to a slot with the given id.
|
void |
clear()
Clear the inventory.
|
void |
clearEnchantments(int slotId)
Clear the enchantments of the item in a slot.
|
void |
clearSlot(int slotId)
Clear the slot with the given id.
|
void |
damageItem(int slotId,
int count)
Damage the item in the slot with the given id.
|
int |
fill(java.lang.String itemName,
int metadata)
Fill up the inventory with the given item.
|
int |
fillSlot(int slotId)
Fill up the slot with the given id.
|
int |
getDamage(int slotId)
Get the damage value of the item in the slot with the given id.
|
float |
getFloatData(int slotId,
java.lang.String name)
Get a stack's float data.
|
int |
getIntData(int slotId,
java.lang.String name)
Get a stack's integer data.
|
int |
getItemCount(java.lang.String itemName,
int metadata)
Get the amount of an item in the inventory.
|
java.lang.String |
getItemName(int slotId)
Get the name of the item in the slot with the given id.
|
int |
getMaxStackSize(int slotId)
Get the maximum stack size of the item in the slot with the given id.
|
int |
getStackSize(int slotId)
Get the stack size of the item in the slot with the given id.
|
java.lang.String |
getStringData(int slotId,
java.lang.String name)
Get a stack's string data.
|
boolean |
hasEnchantment(int slotId,
int id)
Check if the item in a slot has a certain enchantment.
|
boolean |
hasEnchantment(int slotId,
int id,
int level)
Check if the item in a slot has a certain enchantment.
|
boolean |
isItemEqual(int slot1,
int slot2)
Check if the items in two slots are equal
|
void |
moveStack(int from,
int to)
Move as many items as possible from one slot to another.
|
int |
remove(java.lang.String itemName,
int count,
int metadata)
Remove items from the inventory.
|
void |
removeEnnchantment(int slotId,
int id)
Remove a certain enchantment from the item in a slot.
|
int |
removeFromSlot(int slotId,
int count)
Remove the given amount from a slot with the given id.
|
void |
repairItem(int slotId)
Repair the item in the slot with the given id.
|
void |
repairItem(int slotId,
int count)
Repair the item in the slot with the given id by a certain amount.
|
void |
setFloatData(int slotId,
java.lang.String name,
float data)
Set a stack's float data.
|
void |
setIntData(int slotId,
java.lang.String name,
int data)
Set a stack's integer data.
|
int |
setSlot(int slotId,
java.lang.String itemName,
int count,
int metadata)
Set the contents of the slot with the given id.
|
void |
setStringData(int slotId,
java.lang.String name,
java.lang.String data)
Set a stack's string data.
|
public ScriptableInventory(net.minecraft.inventory.IInventory inventory)
public void clear()
public int fill(java.lang.String itemName,
int metadata)
itemName - The item's namemetadata - The item's damage valuepublic int add(java.lang.String itemName,
int count,
int metadata)
itemName - The item's namecount - The amount to add to the inventory.metadata - The item's damage valuepublic int remove(java.lang.String itemName,
int count,
int metadata)
itemName - The item's namecount - The amount to remove from the inventorymetadata - The item's damage valuepublic void clearSlot(int slotId)
slotId - The slot's idpublic int fillSlot(int slotId)
slotId - The slot's idpublic int setSlot(int slotId,
java.lang.String itemName,
int count,
int metadata)
slotId - The slot's iditemName - The item's namecount - The amount of the itemmetadata - The item's damage valuepublic int addToSlot(int slotId,
int count)
slotId - The slot's idcount - The amount to add to the slotpublic int removeFromSlot(int slotId,
int count)
slotId - The slot's idcount - The amount to remove from the slotpublic void damageItem(int slotId,
int count)
slotId - The slot's idcount - The amount of damage to add to the itempublic void repairItem(int slotId)
slotId - The slot's idpublic void repairItem(int slotId,
int count)
slotId - The slot's idcount - The amount of damage to remove from the itempublic java.lang.String getItemName(int slotId)
slotId - The slot's idpublic int getStackSize(int slotId)
slotId - The slot's idpublic int getMaxStackSize(int slotId)
slotId - The slot's idpublic int getDamage(int slotId)
slotId - The slot's idpublic int getItemCount(java.lang.String itemName,
int metadata)
itemName - The item's namemetadata - The item's damage valuepublic void moveStack(int from,
int to)
from - The destination slot's idto - The id of the slot to move the items topublic boolean isItemEqual(int slot1,
int slot2)
slot1 - The first slot's idslot2 - The second slot's idpublic boolean hasEnchantment(int slotId,
int id)
slotId - The slot's idid - The enchantment's idpublic boolean hasEnchantment(int slotId,
int id,
int level)
slotId - The slot's idid - The enchantment's idlevel - The enchantment's levelpublic void clearEnchantments(int slotId)
slotId - The slot's idpublic void addEnchantment(int slotId,
int id,
int level)
slotId - The slot's idid - The enchantment's idlevel - The enchantment's levelpublic void removeEnnchantment(int slotId,
int id)
slotId - The slot's idid - The enchantment's idpublic int getIntData(int slotId,
java.lang.String name)
slotId - The slot's idname - The data's namepublic float getFloatData(int slotId,
java.lang.String name)
slotId - The slot's idname - The data's namepublic java.lang.String getStringData(int slotId,
java.lang.String name)
slotId - The slot's idname - The data's namepublic void setIntData(int slotId,
java.lang.String name,
int data)
slotId - The slot's idname - The data's namedata - The datapublic void setFloatData(int slotId,
java.lang.String name,
float data)
slotId - The slot's idname - The data's namedata - The datapublic void setStringData(int slotId,
java.lang.String name,
java.lang.String data)
slotId - The slot's idname - The data's namedata - The data