001package net.minecraft.inventory; 002 003import net.minecraft.entity.player.EntityPlayer; 004import net.minecraft.item.ItemStack; 005 006public interface IInventory 007{ 008 /** 009 * Returns the number of slots in the inventory. 010 */ 011 int getSizeInventory(); 012 013 /** 014 * Returns the stack in slot i 015 */ 016 ItemStack getStackInSlot(int i); 017 018 /** 019 * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a 020 * new stack. 021 */ 022 ItemStack decrStackSize(int i, int j); 023 024 /** 025 * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - 026 * like when you close a workbench GUI. 027 */ 028 ItemStack getStackInSlotOnClosing(int i); 029 030 /** 031 * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). 032 */ 033 void setInventorySlotContents(int i, ItemStack itemstack); 034 035 /** 036 * Returns the name of the inventory. 037 */ 038 String getInvName(); 039 040 boolean func_94042_c(); 041 042 /** 043 * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't 044 * this more of a set than a get?* 045 */ 046 int getInventoryStackLimit(); 047 048 /** 049 * Called when an the contents of an Inventory change, usually 050 */ 051 void onInventoryChanged(); 052 053 /** 054 * Do not make give this method the name canInteractWith because it clashes with Container 055 */ 056 boolean isUseableByPlayer(EntityPlayer entityplayer); 057 058 void openChest(); 059 060 void closeChest(); 061 062 boolean func_94041_b(int i, ItemStack itemstack); 063}