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 eijintermediary net/minecraft/class_8181named 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 voidclear()default ItemStackgetStack()Returns the stack held by the inventory.default booleanisEmpty()Returns whether the inventory consists entirely of empty item stacks.default ItemStackRemoves the stack held by the inventory.default ItemStackremoveStack(int slot) Removes the stack currently stored atslot.default voidSets the stack held by the inventory tostack.default intsize()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
0tosize() - 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:
isEmptyin interfaceInventory- Returns:
- whether the inventory consists entirely of empty item stacks
- Mappings:
Namespace Name Mixin selector official aa_Lbgj;aa_()Zintermediary method_5442Lnet/minecraft/class_1263;method_5442()Znamed isEmptyLnet/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 aq_Leij;aq_()Lcix;intermediary method_49274Lnet/minecraft/class_8181;method_49274()Lnet/minecraft/class_1799;named getStackLnet/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 jLeij;j()Lcix;intermediary method_49276Lnet/minecraft/class_8181;method_49276()Lnet/minecraft/class_1799;named removeStackLnet/minecraft/inventory/SingleStackInventory;removeStack()Lnet/minecraft/item/ItemStack;
-
setStack
Sets the stack held by the inventory tostack.- Mappings:
Namespace Name Mixin selector official bLeij;b(Lcix;)Vintermediary method_49275Lnet/minecraft/class_8181;method_49275(Lnet/minecraft/class_1799;)Vnamed setStackLnet/minecraft/inventory/SingleStackInventory;setStack(Lnet/minecraft/item/ItemStack;)V
-
removeStack
Removes the stack currently stored atslot.- Specified by:
removeStackin interfaceInventory- Returns:
- the stack previously stored at the indicated slot
- Mappings:
Namespace Name Mixin selector official bLbgj;b(I)Lcix;intermediary method_5441Lnet/minecraft/class_1263;method_5441(I)Lnet/minecraft/class_1799;named removeStackLnet/minecraft/inventory/Inventory;removeStack(I)Lnet/minecraft/item/ItemStack;
-