Package net.minecraft.src
Interface IInventory
- All Known Subinterfaces:
Hopper,ISidedInventory
- All Known Implementing Classes:
AnimalChest,BlockDispenserTileEntity,CauldronTileEntity,CookingVesselTileEntity,CrucibleTileEntity,EntityMinecartChest,EntityMinecartContainer,EntityMinecartHopper,HamperTileEntity,HopperTileEntity,InfernalEnchanterInventory,InventoryBasic,InventoryCrafting,InventoryCraftResult,InventoryEnderChest,InventoryLargeChest,InventoryMerchant,InventoryPlayer,LoomTileEntity,MillstoneTileEntity,OvenTileEntity,PulleyTileEntity,TileEntityBeacon,TileEntityBrewingStand,TileEntityChest,TileEntityDispenser,TileEntityDropper,TileEntityFurnace,TileEntityHopper,VaseTileEntity
public interface IInventory
-
Method Summary
Modifier and TypeMethodDescriptionvoiddecrStackSize(int var1, int var2) Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new stack.intReturns the maximum stack size for a inventory slot.Returns the name of the inventory.intReturns the number of slots in the inventory.getStackInSlot(int var1) Returns the stack in slot igetStackInSlotOnClosing(int var1) When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like when you close a workbench GUI.booleanIf this returns false, the inventory name will be used as an unlocalized name, and translated into the player's language.booleanisItemValidForSlot(int var1, ItemStack var2) Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.booleanDo not make give this method the name canInteractWith because it clashes with ContainervoidCalled when an the contents of an Inventory change, usuallyvoidvoidsetInventorySlotContents(int var1, ItemStack var2) Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
-
Method Details
-
getSizeInventory
int getSizeInventory()Returns the number of slots in the inventory. -
getStackInSlot
Returns the stack in slot i -
decrStackSize
Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new stack. -
getStackInSlotOnClosing
When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like when you close a workbench GUI. -
setInventorySlotContents
Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). -
getInvName
String getInvName()Returns the name of the inventory. -
isInvNameLocalized
boolean isInvNameLocalized()If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's language. Otherwise it will be used directly. -
getInventoryStackLimit
int getInventoryStackLimit()Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this more of a set than a get?* -
onInventoryChanged
void onInventoryChanged()Called when an the contents of an Inventory change, usually -
isUseableByPlayer
Do not make give this method the name canInteractWith because it clashes with Container -
openChest
void openChest() -
closeChest
void closeChest() -
isItemValidForSlot
Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.
-