Modifier and Type | Field and Description |
---|---|
private Inventory |
first |
private Inventory |
second |
Constructor and Description |
---|
DoubleInventory(Inventory first,
Inventory second) |
Modifier and Type | Method and Description |
---|---|
boolean |
canPlayerUse(PlayerEntity player) |
void |
clear() |
int |
getMaxCountPerStack()
Returns the maximum number of items a stack can contain when placed inside this inventory.
|
ItemStack |
getStack(int slot)
Fetches the stack currently stored at the given slot.
|
boolean |
isEmpty() |
boolean |
isPart(Inventory inventory) |
boolean |
isValid(int slot,
ItemStack stack)
Returns whether the given stack is a valid for the indicated slot position.
|
void |
markDirty() |
void |
onClose(PlayerEntity player) |
void |
onOpen(PlayerEntity player) |
ItemStack |
removeStack(int slot)
Removes the stack currently stored at the indicated slot.
|
ItemStack |
removeStack(int slot,
int amount)
Removes a specific number of items from the given slot.
|
void |
setStack(int slot,
ItemStack stack) |
int |
size() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
containsAny, count
public boolean isPart(Inventory inventory)
public ItemStack getStack(int slot)
ItemStack.EMPTY
.public ItemStack removeStack(int slot, int amount)
removeStack
in interface Inventory
public ItemStack removeStack(int slot)
removeStack
in interface Inventory
public void setStack(int slot, ItemStack stack)
public int getMaxCountPerStack()
getMaxCountPerStack
in interface Inventory
count
of item stacks in this inventorypublic boolean canPlayerUse(PlayerEntity player)
canPlayerUse
in interface Inventory
public void onOpen(PlayerEntity player)
public void onClose(PlayerEntity player)
public boolean isValid(int slot, ItemStack stack)