public interface IInventory extends IClearable
修飾子とタイプ | メソッドと説明 |
---|---|
default void |
closeInventory(PlayerEntity player) |
default int |
count(Item itemIn)
Returns the total amount of the specified item in this inventory.
|
ItemStack |
decrStackSize(int index,
int count)
Removes up to a specified number of items from an inventory slot and returns them in a new stack.
|
default int |
getInventoryStackLimit()
Returns the maximum stack size for a inventory slot.
|
int |
getSizeInventory()
Returns the number of slots in the inventory.
|
ItemStack |
getStackInSlot(int index)
Returns the stack in the given slot.
|
default boolean |
hasAny(java.util.Set<Item> set)
Returns true if any item from the passed set exists in this inventory.
|
boolean |
isEmpty() |
default boolean |
isItemValidForSlot(int index,
ItemStack stack)
Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.
|
boolean |
isUsableByPlayer(PlayerEntity player)
Don't rename this method to canInteractWith due to conflicts with Container
|
void |
markDirty()
For tile entities, ensures the chunk containing the tile entity is saved to disk later - the game won't think it
hasn't changed and skip it.
|
default void |
openInventory(PlayerEntity player) |
ItemStack |
removeStackFromSlot(int index)
Removes a stack from the given slot and returns it.
|
void |
setInventorySlotContents(int index,
ItemStack stack)
Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
|
clear, clearObj
int getSizeInventory()
boolean isEmpty()
ItemStack getStackInSlot(int index)
ItemStack decrStackSize(int index, int count)
ItemStack removeStackFromSlot(int index)
void setInventorySlotContents(int index, ItemStack stack)
default int getInventoryStackLimit()
void markDirty()
boolean isUsableByPlayer(PlayerEntity player)
default void openInventory(PlayerEntity player)
default void closeInventory(PlayerEntity player)
default boolean isItemValidForSlot(int index, ItemStack stack)
default int count(Item itemIn)
default boolean hasAny(java.util.Set<Item> set)