Package net.minecraft.inventory
Class DoubleInventory
java.lang.Object
net.minecraft.inventory.DoubleInventory
public class DoubleInventory extends Object implements Inventory
-
Field Summary
-
Constructor Summary
Constructors Constructor Description DoubleInventory(Inventory first, Inventory second)
-
Method Summary
Modifier and Type Method 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()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.inventory.Inventory
containsAny, count
-
Field Details
-
first
-
second
-
-
Constructor Details
-
DoubleInventory
-
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
isPart
-
getStack
Fetches the stack currently stored at the given slot. If the slot is empty, or is outside the bounds of this inventory, returns seeItemStack.EMPTY
. -
removeStack
Removes a specific number of items from the given slot.- Specified by:
removeStack
in interfaceInventory
- Returns:
- the removed items as a stack
-
removeStack
Removes the stack currently stored at the indicated slot.- Specified by:
removeStack
in interfaceInventory
- Returns:
- the stack previously stored at the indicated slot.
-
setStack
-
getMaxCountPerStack
public int getMaxCountPerStack()Returns the maximum number of items a stack can contain when placed inside this inventory. No slots may have more than this number of items. It is effectively the stacking limit for this inventory's slots.- Specified by:
getMaxCountPerStack
in interfaceInventory
- Returns:
- the max
count
of item stacks in this inventory
-
markDirty
public void markDirty() -
canPlayerUse
- Specified by:
canPlayerUse
in interfaceInventory
-
onOpen
-
onClose
-
isValid
Returns whether the given stack is a valid for the indicated slot position. -
clear
public void clear()
-