public class Inventory extends java.lang.Object implements IInventory, IRecipeHelperPopulator
Modifier and Type | Field and Description |
---|---|
private NonNullList<ItemStack> |
inventoryContents |
private java.util.List<IInventoryChangedListener> |
listeners |
private int |
slotsCount |
Constructor and Description |
---|
Inventory(int numSlots) |
Inventory(ItemStack... stacksIn) |
Modifier and Type | Method and Description |
---|---|
ItemStack |
addItem(ItemStack stack) |
void |
addListener(IInventoryChangedListener listener) |
void |
clear() |
ItemStack |
decrStackSize(int index,
int count) |
void |
fillStackedContents(RecipeItemHelper helper) |
private void |
func_223372_c(ItemStack p_223372_1_) |
private void |
func_223373_a(ItemStack p_223373_1_,
ItemStack p_223373_2_) |
ItemStack |
func_223374_a(Item p_223374_1_,
int p_223374_2_) |
private void |
func_223375_b(ItemStack p_223375_1_) |
int |
getSizeInventory() |
ItemStack |
getStackInSlot(int index) |
boolean |
isEmpty() |
boolean |
isUsableByPlayer(PlayerEntity player) |
void |
markDirty() |
void |
removeListener(IInventoryChangedListener listener) |
ItemStack |
removeStackFromSlot(int index) |
void |
setInventorySlotContents(int index,
ItemStack stack) |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
closeInventory, count, getInventoryStackLimit, hasAny, isItemValidForSlot, openInventory
clearObj
private final int slotsCount
private final NonNullList<ItemStack> inventoryContents
private java.util.List<IInventoryChangedListener> listeners
public Inventory(int numSlots)
public Inventory(ItemStack... stacksIn)
public void addListener(IInventoryChangedListener listener)
public void removeListener(IInventoryChangedListener listener)
public ItemStack getStackInSlot(int index)
getStackInSlot
in interface IInventory
public ItemStack decrStackSize(int index, int count)
decrStackSize
in interface IInventory
public ItemStack removeStackFromSlot(int index)
removeStackFromSlot
in interface IInventory
public void setInventorySlotContents(int index, ItemStack stack)
setInventorySlotContents
in interface IInventory
public int getSizeInventory()
getSizeInventory
in interface IInventory
public boolean isEmpty()
isEmpty
in interface IInventory
public void markDirty()
markDirty
in interface IInventory
public boolean isUsableByPlayer(PlayerEntity player)
isUsableByPlayer
in interface IInventory
public void clear()
clear
in interface IClearable
public void fillStackedContents(RecipeItemHelper helper)
fillStackedContents
in interface IRecipeHelperPopulator
public java.lang.String toString()
toString
in class java.lang.Object
private void func_223375_b(ItemStack p_223375_1_)
private void func_223372_c(ItemStack p_223372_1_)