Package appeng.api.inventories
Interface InternalInventory
- All Superinterfaces:
ItemTransfer,Iterable<net.minecraft.world.item.ItemStack>
- All Known Subinterfaces:
IUpgradeInventory
- All Known Implementing Classes:
BaseInternalInventory,DelegateItemUpgradeInventory,PlatformInventoryWrapper,appeng.util.inv.SupplierInternalInventory
public interface InternalInventory
extends Iterable<net.minecraft.world.item.ItemStack>, ItemTransfer
-
Method Summary
Modifier and TypeMethodDescriptiondefault net.minecraft.world.item.ItemStackaddItems(net.minecraft.world.item.ItemStack stack) Attempts to insert as much of the given item into this inventory as possible.default net.minecraft.world.item.ItemStackaddItems(net.minecraft.world.item.ItemStack stack, boolean simulate) Attempts to insert as much of the given item into this inventory as possible.default voidclear()static InternalInventoryempty()default net.minecraft.world.item.ItemStackextractItem(int slot, int amount, boolean simulate) default intdefault InternalInventorygetSlotInv(int slotIndex) default intgetSlotLimit(int slot) net.minecraft.world.item.ItemStackgetStackInSlot(int slotIndex) default InternalInventorygetSubInventory(int fromSlotInclusive, int toSlotExclusive) default net.minecraft.world.item.ItemStackinsertItem(int slot, net.minecraft.world.item.ItemStack stack, boolean simulate) default booleanisEmpty()default booleanisItemValid(int slot, net.minecraft.world.item.ItemStack stack) default Iterator<net.minecraft.world.item.ItemStack> iterator()default net.minecraft.world.item.ItemStackremoveItems(int amount, net.minecraft.world.item.ItemStack filter, @Nullable Predicate<net.minecraft.world.item.ItemStack> destination) default net.minecraft.world.item.ItemStackremoveSimilarItems(int amount, net.minecraft.world.item.ItemStack filter, FuzzyMode fuzzyMode, Predicate<net.minecraft.world.item.ItemStack> destination) For fuzzy extract, we will only ever extract one slot, since we're afraid of merging two item stacks with different damage values.default voidsendChangeNotification(int slot) Forces a change notification to any listeners for the given slot.voidsetItemDirect(int slotIndex, net.minecraft.world.item.ItemStack stack) Puts the given stack in the given slot and circumvents any potential filters.default net.minecraft.world.item.ItemStacksimulateAdd(net.minecraft.world.item.ItemStack stack) default net.minecraft.world.item.ItemStacksimulateRemove(int amount, net.minecraft.world.item.ItemStack filter, Predicate<net.minecraft.world.item.ItemStack> destination) default net.minecraft.world.item.ItemStacksimulateSimilarRemove(int amount, net.minecraft.world.item.ItemStack filter, FuzzyMode fuzzyMode, Predicate<net.minecraft.world.item.ItemStack> destination) intsize()default net.minecraft.world.Containerdefault net.neoforged.neoforge.items.IItemHandlerstatic @Nullable ItemTransferwrapExternal(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side) Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
wrapExternal
@Nullable static @Nullable ItemTransfer wrapExternal(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side) -
empty
-
clear
default void clear() -
isEmpty
default boolean isEmpty() -
toItemHandler
default net.neoforged.neoforge.items.IItemHandler toItemHandler() -
toContainer
default net.minecraft.world.Container toContainer() -
size
int size() -
getSlotLimit
default int getSlotLimit(int slot) -
getStackInSlot
net.minecraft.world.item.ItemStack getStackInSlot(int slotIndex) -
setItemDirect
void setItemDirect(int slotIndex, net.minecraft.world.item.ItemStack stack) Puts the given stack in the given slot and circumvents any potential filters. -
isItemValid
default boolean isItemValid(int slot, net.minecraft.world.item.ItemStack stack) -
getSubInventory
-
getSlotInv
-
getRedstoneSignal
default int getRedstoneSignal()- Returns:
- The redstone signal indicating how full this container is in the [0-15] range.
-
iterator
-
addItems
default net.minecraft.world.item.ItemStack addItems(net.minecraft.world.item.ItemStack stack) Attempts to insert as much of the given item into this inventory as possible.- Specified by:
addItemsin interfaceItemTransfer- Parameters:
stack- The stack to insert. Will not be mutated.- Returns:
- The overflow, which can be the same object as stack.
-
simulateAdd
default net.minecraft.world.item.ItemStack simulateAdd(net.minecraft.world.item.ItemStack stack) - Specified by:
simulateAddin interfaceItemTransfer
-
addItems
default net.minecraft.world.item.ItemStack addItems(net.minecraft.world.item.ItemStack stack, boolean simulate) Attempts to insert as much of the given item into this inventory as possible.- Specified by:
addItemsin interfaceItemTransfer- Parameters:
stack- The stack to insert. Will not be mutated.- Returns:
- The overflow, which can be the same object as stack.
-
removeItems
default net.minecraft.world.item.ItemStack removeItems(int amount, net.minecraft.world.item.ItemStack filter, @Nullable @Nullable Predicate<net.minecraft.world.item.ItemStack> destination) - Specified by:
removeItemsin interfaceItemTransfer
-
simulateRemove
default net.minecraft.world.item.ItemStack simulateRemove(int amount, net.minecraft.world.item.ItemStack filter, Predicate<net.minecraft.world.item.ItemStack> destination) - Specified by:
simulateRemovein interfaceItemTransfer
-
removeSimilarItems
default net.minecraft.world.item.ItemStack removeSimilarItems(int amount, net.minecraft.world.item.ItemStack filter, FuzzyMode fuzzyMode, Predicate<net.minecraft.world.item.ItemStack> destination) For fuzzy extract, we will only ever extract one slot, since we're afraid of merging two item stacks with different damage values.- Specified by:
removeSimilarItemsin interfaceItemTransfer
-
simulateSimilarRemove
default net.minecraft.world.item.ItemStack simulateSimilarRemove(int amount, net.minecraft.world.item.ItemStack filter, FuzzyMode fuzzyMode, Predicate<net.minecraft.world.item.ItemStack> destination) - Specified by:
simulateSimilarRemovein interfaceItemTransfer
-
insertItem
default net.minecraft.world.item.ItemStack insertItem(int slot, net.minecraft.world.item.ItemStack stack, boolean simulate) - Returns:
- The overflow
-
extractItem
default net.minecraft.world.item.ItemStack extractItem(int slot, int amount, boolean simulate) -
sendChangeNotification
@Internal default void sendChangeNotification(int slot) Forces a change notification to any listeners for the given slot. For internal use only. This should also cause the inventory to be saved.
-