Package net.minecraft.src
Class InventoryBasic
java.lang.Object
net.minecraft.src.InventoryBasic
- All Implemented Interfaces:
IInventory
- Direct Known Subclasses:
AnimalChest,InfernalEnchanterInventory,InventoryEnderChest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddecrStackSize(int par1, int par2) Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new stack.voidfunc_110132_b(IInvBasic par1IInvBasic) voidfunc_110133_a(String par1Str) voidfunc_110134_a(IInvBasic par1IInvBasic) 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 par1) Returns the stack in slot igetStackInSlotOnClosing(int par1) 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 par1, ItemStack par2ItemStack) Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.booleanisUseableByPlayer(EntityPlayer par1EntityPlayer) Do not make give this method the name canInteractWith because it clashes with ContainervoidCalled when an the contents of an Inventory change, usuallyvoidvoidsetInventorySlotContents(int par1, ItemStack par2ItemStack) Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
-
Constructor Details
-
InventoryBasic
-
-
Method Details
-
func_110134_a
-
func_110132_b
-
getStackInSlot
Returns the stack in slot i- Specified by:
getStackInSlotin interfaceIInventory
-
decrStackSize
Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new stack.- Specified by:
decrStackSizein interfaceIInventory
-
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.- Specified by:
getStackInSlotOnClosingin interfaceIInventory
-
setInventorySlotContents
Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).- Specified by:
setInventorySlotContentsin interfaceIInventory
-
getSizeInventory
public int getSizeInventory()Returns the number of slots in the inventory.- Specified by:
getSizeInventoryin interfaceIInventory
-
getInvName
Returns the name of the inventory.- Specified by:
getInvNamein interfaceIInventory
-
isInvNameLocalized
public 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.- Specified by:
isInvNameLocalizedin interfaceIInventory
-
func_110133_a
-
getInventoryStackLimit
public 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?*- Specified by:
getInventoryStackLimitin interfaceIInventory
-
onInventoryChanged
public void onInventoryChanged()Called when an the contents of an Inventory change, usually- Specified by:
onInventoryChangedin interfaceIInventory
-
isUseableByPlayer
Do not make give this method the name canInteractWith because it clashes with Container- Specified by:
isUseableByPlayerin interfaceIInventory
-
openChest
public void openChest()- Specified by:
openChestin interfaceIInventory
-
closeChest
public void closeChest()- Specified by:
closeChestin interfaceIInventory
-
isItemValidForSlot
Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.- Specified by:
isItemValidForSlotin interfaceIInventory
-