Package net.minecraft.inventory
Class SimpleInventory
java.lang.Object
net.minecraft.inventory.SimpleInventory
- All Implemented Interfaces:
- Inventory,- RecipeInputProvider,- Clearable
- Direct Known Subclasses:
- ComposterBlock.ComposterInventory,- ComposterBlock.DummyInventory,- ComposterBlock.FullComposterInventory,- EnderChestInventory
- Mappings:
- Namespace - Name - official - bee- intermediary - net/minecraft/class_1277- named - net/minecraft/inventory/SimpleInventory
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate @Nullable List<InventoryChangedListener>private final intprivate final DefaultedList<ItemStack>Fields inherited from interface net.minecraft.inventory.Inventoryfield_42619, MAX_COUNT_PER_STACK
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddListener(InventoryChangedListener listener) private voidaddToExistingSlot(ItemStack stack) private voidaddToNewSlot(ItemStack stack) booleanbooleancanPlayerUse(PlayerEntity player) voidclear()Clears this inventory and return all the non-empty stacks in a list.getStack(int slot) Fetches the stack currently stored at the given slot.booleanisEmpty()voidvoidprovideRecipeInputs(RecipeMatcher finder) voidreadNbtList(NbtList nbtList) removeItem(Item item, int count) Searches this inventory for the specified item and removes the given amount from this inventory.voidremoveListener(InventoryChangedListener listener) removeStack(int slot) Removes the stack currently stored at the indicated slot.removeStack(int slot, int amount) Removes a specific number of items from the given slot.voidintsize()toString()private voidMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.inventory.InventorycanTransferTo, containsAny, containsAny, count, getMaxCountPerStack, isValid, onClose, onOpen
- 
Field Details- 
sizeprivate final int size- Mappings:
- Namespace - Name - Mixin selector - official - c- Lbee;c:I- intermediary - field_5831- Lnet/minecraft/class_1277;field_5831:I- named - size- Lnet/minecraft/inventory/SimpleInventory;size:I
 
- 
stacks- Mappings:
- Namespace - Name - Mixin selector - official - d- Lbee;d:Lhn;- intermediary - field_5828- Lnet/minecraft/class_1277;field_5828:Lnet/minecraft/class_2371;- named - stacks- Lnet/minecraft/inventory/SimpleInventory;stacks:Lnet/minecraft/util/collection/DefaultedList;
 
- 
listeners- Mappings:
- Namespace - Name - Mixin selector - official - e- Lbee;e:Ljava/util/List;- intermediary - field_5829- Lnet/minecraft/class_1277;field_5829:Ljava/util/List;- named - listeners- Lnet/minecraft/inventory/SimpleInventory;listeners:Ljava/util/List;
 
 
- 
- 
Constructor Details- 
SimpleInventorypublic SimpleInventory(int size) - Mappings:
- Namespace - Name - Mixin selector - official - <init>- Lbee;<init>(I)V- intermediary - <init>- Lnet/minecraft/class_1277;<init>(I)V- named - <init>- Lnet/minecraft/inventory/SimpleInventory;<init>(I)V
 
- 
SimpleInventory- Mappings:
- Namespace - Name - Mixin selector - official - <init>- Lbee;<init>([Lcfz;)V- intermediary - <init>- Lnet/minecraft/class_1277;<init>([Lnet/minecraft/class_1799;)V- named - <init>- Lnet/minecraft/inventory/SimpleInventory;<init>([Lnet/minecraft/item/ItemStack;)V
 
 
- 
- 
Method Details- 
addListener- Mappings:
- Namespace - Name - Mixin selector - official - a- Lbee;a(Lbds;)V- intermediary - method_5489- Lnet/minecraft/class_1277;method_5489(Lnet/minecraft/class_1265;)V- named - addListener- Lnet/minecraft/inventory/SimpleInventory;addListener(Lnet/minecraft/inventory/InventoryChangedListener;)V
 
- 
removeListener- Mappings:
- Namespace - Name - Mixin selector - official - b- Lbee;b(Lbds;)V- intermediary - method_5488- Lnet/minecraft/class_1277;method_5488(Lnet/minecraft/class_1265;)V- named - removeListener- Lnet/minecraft/inventory/SimpleInventory;removeListener(Lnet/minecraft/inventory/InventoryChangedListener;)V
 
- 
getStackFetches the stack currently stored at the given slot. If the slot is empty, or is outside the bounds of this inventory, returns seeItemStack.EMPTY.
- 
clearToListClears this inventory and return all the non-empty stacks in a list.- Mappings:
- Namespace - Name - Mixin selector - official - f- Lbee;f()Ljava/util/List;- intermediary - method_24514- Lnet/minecraft/class_1277;method_24514()Ljava/util/List;- named - clearToList- Lnet/minecraft/inventory/SimpleInventory;clearToList()Ljava/util/List;
 
- 
removeStackRemoves a specific number of items from the given slot.- Specified by:
- removeStackin interface- Inventory
- Returns:
- the removed items as a stack
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lbdq;a(II)Lcfz;- intermediary - method_5434- Lnet/minecraft/class_1263;method_5434(II)Lnet/minecraft/class_1799;- named - removeStack- Lnet/minecraft/inventory/Inventory;removeStack(II)Lnet/minecraft/item/ItemStack;
 
- 
removeItemSearches this inventory for the specified item and removes the given amount from this inventory.- Returns:
- the stack of removed items
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lbee;a(Lcfu;I)Lcfz;- intermediary - method_20631- Lnet/minecraft/class_1277;method_20631(Lnet/minecraft/class_1792;I)Lnet/minecraft/class_1799;- named - removeItem- Lnet/minecraft/inventory/SimpleInventory;removeItem(Lnet/minecraft/item/Item;I)Lnet/minecraft/item/ItemStack;
 
- 
addStack- Mappings:
- Namespace - Name - Mixin selector - official - a- Lbee;a(Lcfz;)Lcfz;- intermediary - method_5491- Lnet/minecraft/class_1277;method_5491(Lnet/minecraft/class_1799;)Lnet/minecraft/class_1799;- named - addStack- Lnet/minecraft/inventory/SimpleInventory;addStack(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/item/ItemStack;
 
- 
canInsert- Mappings:
- Namespace - Name - Mixin selector - official - b- Lbee;b(Lcfz;)Z- intermediary - method_27070- Lnet/minecraft/class_1277;method_27070(Lnet/minecraft/class_1799;)Z- named - canInsert- Lnet/minecraft/inventory/SimpleInventory;canInsert(Lnet/minecraft/item/ItemStack;)Z
 
- 
removeStackRemoves the stack currently stored at the indicated slot.- Specified by:
- removeStackin interface- Inventory
- Returns:
- the stack previously stored at the indicated slot.
- Mappings:
- Namespace - Name - Mixin selector - official - b- Lbdq;b(I)Lcfz;- 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;
 
- 
setStack
- 
sizepublic int size()
- 
isEmptypublic boolean isEmpty()
- 
markDirtypublic void markDirty()
- 
canPlayerUse- Specified by:
- canPlayerUsein interface- Inventory
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lbdq;a(Lbyo;)Z- intermediary - method_5443- Lnet/minecraft/class_1263;method_5443(Lnet/minecraft/class_1657;)Z- named - canPlayerUse- Lnet/minecraft/inventory/Inventory;canPlayerUse(Lnet/minecraft/entity/player/PlayerEntity;)Z
 
- 
clearpublic void clear()
- 
provideRecipeInputs- Specified by:
- provideRecipeInputsin interface- RecipeInputProvider
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lcda;a(Lbys;)V- intermediary - method_7683- Lnet/minecraft/class_1737;method_7683(Lnet/minecraft/class_1662;)V- named - provideRecipeInputs- Lnet/minecraft/recipe/RecipeInputProvider;provideRecipeInputs(Lnet/minecraft/recipe/RecipeMatcher;)V
 
- 
toString
- 
addToNewSlot- Mappings:
- Namespace - Name - Mixin selector - official - c- Lbee;c(Lcfz;)V- intermediary - method_20633- Lnet/minecraft/class_1277;method_20633(Lnet/minecraft/class_1799;)V- named - addToNewSlot- Lnet/minecraft/inventory/SimpleInventory;addToNewSlot(Lnet/minecraft/item/ItemStack;)V
 
- 
addToExistingSlot- Mappings:
- Namespace - Name - Mixin selector - official - d- Lbee;d(Lcfz;)V- intermediary - method_20634- Lnet/minecraft/class_1277;method_20634(Lnet/minecraft/class_1799;)V- named - addToExistingSlot- Lnet/minecraft/inventory/SimpleInventory;addToExistingSlot(Lnet/minecraft/item/ItemStack;)V
 
- 
transfer- Mappings:
- Namespace - Name - Mixin selector - official - a- Lbee;a(Lcfz;Lcfz;)V- intermediary - method_20632- Lnet/minecraft/class_1277;method_20632(Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;)V- named - transfer- Lnet/minecraft/inventory/SimpleInventory;transfer(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)V
 
- 
readNbtList- Mappings:
- Namespace - Name - Mixin selector - official - a- Lbee;a(Lqx;)V- intermediary - method_7659- Lnet/minecraft/class_1277;method_7659(Lnet/minecraft/class_2499;)V- named - readNbtList- Lnet/minecraft/inventory/SimpleInventory;readNbtList(Lnet/minecraft/nbt/NbtList;)V
 
- 
toNbtList- Mappings:
- Namespace - Name - Mixin selector - official - g- Lbee;g()Lqx;- intermediary - method_7660- Lnet/minecraft/class_1277;method_7660()Lnet/minecraft/class_2499;- named - toNbtList- Lnet/minecraft/inventory/SimpleInventory;toNbtList()Lnet/minecraft/nbt/NbtList;
 
 
-