Package net.minecraft.inventory
Interface SingleStackInventory
- All Known Implementing Classes:
JukeboxBlockEntity
An inventory that holds exactly one
ItemStack
, at slot 0
.- Mappings:
Namespace Name official eit
intermediary net/minecraft/class_8181
named net/minecraft/inventory/SingleStackInventory
-
Field Summary
Fields inherited from interface net.minecraft.inventory.Inventory
field_42619, MAX_COUNT_PER_STACK
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
clear()
default ItemStack
getStack()
Returns the stack held by the inventory.default boolean
isEmpty()
Returns whether the inventory consists entirely of empty item stacks.default ItemStack
Removes the stack held by the inventory.default ItemStack
removeStack
(int slot) Removes the stack currently stored atslot
.default void
Sets the stack held by the inventory tostack
.default int
size()
Returns the size of the inventory.Methods inherited from interface net.minecraft.inventory.Inventory
canPlayerUse, canTransferTo, containsAny, containsAny, count, getMaxCountPerStack, getStack, isValid, markDirty, onClose, onOpen, removeStack, setStack
-
Method Details
-
size
default int size()Returns the size of the inventory.The inventory should support the slot ID from
0
tosize() - 1
. This should remain constant throughout the inventory's lifetime. -
isEmpty
default boolean isEmpty()Returns whether the inventory consists entirely of empty item stacks.- Specified by:
isEmpty
in interfaceInventory
- Returns:
- whether the inventory consists entirely of empty item stacks
- Mappings:
Namespace Name Mixin selector official af_
Lbgr;af_()Z
intermediary method_5442
Lnet/minecraft/class_1263;method_5442()Z
named isEmpty
Lnet/minecraft/inventory/Inventory;isEmpty()Z
-
clear
default void clear() -
getStack
Returns the stack held by the inventory.- Returns:
- the stack held by the inventory
- Mappings:
Namespace Name Mixin selector official av_
Leit;av_()Lcjf;
intermediary method_49274
Lnet/minecraft/class_8181;method_49274()Lnet/minecraft/class_1799;
named getStack
Lnet/minecraft/inventory/SingleStackInventory;getStack()Lnet/minecraft/item/ItemStack;
-
removeStack
Removes the stack held by the inventory.- Returns:
- the removed stack
- Mappings:
Namespace Name Mixin selector official j
Leit;j()Lcjf;
intermediary method_49276
Lnet/minecraft/class_8181;method_49276()Lnet/minecraft/class_1799;
named removeStack
Lnet/minecraft/inventory/SingleStackInventory;removeStack()Lnet/minecraft/item/ItemStack;
-
setStack
Sets the stack held by the inventory tostack
.- Mappings:
Namespace Name Mixin selector official b
Leit;b(Lcjf;)V
intermediary method_49275
Lnet/minecraft/class_8181;method_49275(Lnet/minecraft/class_1799;)V
named setStack
Lnet/minecraft/inventory/SingleStackInventory;setStack(Lnet/minecraft/item/ItemStack;)V
-
removeStack
Removes the stack currently stored atslot
.- Specified by:
removeStack
in interfaceInventory
- Returns:
- the stack previously stored at the indicated slot
- Mappings:
Namespace Name Mixin selector official b
Lbgr;b(I)Lcjf;
intermediary method_5441
Lnet/minecraft/class_1263;method_5441(I)Lnet/minecraft/class_1799;
named removeStack
Lnet/minecraft/inventory/Inventory;removeStack(I)Lnet/minecraft/item/ItemStack;
-