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 booleancanPlayerUse(PlayerEntity player)voidclear()intgetMaxCountPerStack()Returns the maximum number of items a stack can contain when placed inside this inventory.ItemStackgetStack(int slot)Fetches the stack currently stored at the given slot.booleanisEmpty()booleanisPart(Inventory inventory)booleanisValid(int slot, ItemStack stack)Returns whether the given stack is a valid for the indicated slot position.voidmarkDirty()voidonClose(PlayerEntity player)voidonOpen(PlayerEntity player)ItemStackremoveStack(int slot)Removes the stack currently stored at the indicated slot.ItemStackremoveStack(int slot, int amount)Removes a specific number of items from the given slot.voidsetStack(int slot, ItemStack stack)intsize()
-
Field Details
-
Constructor Details
-
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:
removeStackin interfaceInventory- Returns:
- the removed items as a stack
-
removeStack
Removes the stack currently stored at the indicated slot.- Specified by:
removeStackin 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:
getMaxCountPerStackin interfaceInventory- Returns:
- the max
countof item stacks in this inventory
-
markDirty
public void markDirty() -
canPlayerUse
- Specified by:
canPlayerUsein interfaceInventory
-
onOpen
-
onClose
-
isValid
Returns whether the given stack is a valid for the indicated slot position. -
clear
public void clear()
-