public class SimpleInventory
extends java.lang.Object
implements net.minecraft.inventory.IInventory
| Constructor and Description |
|---|
SimpleInventory(int size,
java.lang.String name,
int stackLimit)
Make a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
closeInventory() |
net.minecraft.item.ItemStack |
decrStackSize(int slotId,
int count) |
java.lang.String |
getInventoryName() |
int |
getInventoryStackLimit() |
net.minecraft.item.ItemStack[] |
getItemStacks()
Get the array of
ItemStack inside this inventory. |
int |
getSizeInventory() |
net.minecraft.item.ItemStack |
getStackInSlot(int slotId) |
net.minecraft.item.ItemStack |
getStackInSlotOnClosing(int slotId) |
boolean |
hasCustomInventoryName() |
boolean |
isItemValidForSlot(int i,
net.minecraft.item.ItemStack itemstack) |
boolean |
isUseableByPlayer(net.minecraft.entity.player.EntityPlayer entityplayer) |
void |
markDirty() |
void |
openInventory() |
void |
readFromNBT(net.minecraft.nbt.NBTTagCompound data)
Read inventory data from the given NBT.
|
void |
readFromNBT(net.minecraft.nbt.NBTTagCompound data,
java.lang.String tag)
Read inventory data from the given NBT.
|
void |
setInventorySlotContents(int slotId,
net.minecraft.item.ItemStack itemstack) |
void |
writeToNBT(net.minecraft.nbt.NBTTagCompound data)
Write inventory data to the given NBT.
|
void |
writeToNBT(net.minecraft.nbt.NBTTagCompound data,
java.lang.String tag)
Write inventory data to the given NBT.
|
public SimpleInventory(int size,
java.lang.String name,
int stackLimit)
size - The amount of slots in the inventory.name - The name of the inventory, used for NBT storage.stackLimit - The stack limit for each slot.public int getSizeInventory()
getSizeInventory in interface net.minecraft.inventory.IInventorypublic net.minecraft.item.ItemStack getStackInSlot(int slotId)
getStackInSlot in interface net.minecraft.inventory.IInventorypublic net.minecraft.item.ItemStack decrStackSize(int slotId,
int count)
decrStackSize in interface net.minecraft.inventory.IInventorypublic void setInventorySlotContents(int slotId,
net.minecraft.item.ItemStack itemstack)
setInventorySlotContents in interface net.minecraft.inventory.IInventorypublic java.lang.String getInventoryName()
getInventoryName in interface net.minecraft.inventory.IInventorypublic int getInventoryStackLimit()
getInventoryStackLimit in interface net.minecraft.inventory.IInventorypublic boolean isUseableByPlayer(net.minecraft.entity.player.EntityPlayer entityplayer)
isUseableByPlayer in interface net.minecraft.inventory.IInventorypublic void openInventory()
openInventory in interface net.minecraft.inventory.IInventorypublic void closeInventory()
closeInventory in interface net.minecraft.inventory.IInventorypublic void readFromNBT(net.minecraft.nbt.NBTTagCompound data)
data - The NBT data containing inventory data.public void readFromNBT(net.minecraft.nbt.NBTTagCompound data,
java.lang.String tag)
data - The NBT data containing inventory data.tag - The NBT tag name where the info is located.public void writeToNBT(net.minecraft.nbt.NBTTagCompound data)
data - The NBT tag that will receive inventory data.public void writeToNBT(net.minecraft.nbt.NBTTagCompound data,
java.lang.String tag)
data - The NBT tag that will receive inventory data.tag - The NBT tag name where the info must be located.public net.minecraft.item.ItemStack getStackInSlotOnClosing(int slotId)
getStackInSlotOnClosing in interface net.minecraft.inventory.IInventorypublic net.minecraft.item.ItemStack[] getItemStacks()
ItemStack inside this inventory.public boolean hasCustomInventoryName()
hasCustomInventoryName in interface net.minecraft.inventory.IInventorypublic boolean isItemValidForSlot(int i,
net.minecraft.item.ItemStack itemstack)
isItemValidForSlot in interface net.minecraft.inventory.IInventorypublic void markDirty()
markDirty in interface net.minecraft.inventory.IInventory