Package appeng.api.inventories
Class PlatformInventoryWrapper
java.lang.Object
appeng.api.inventories.PlatformInventoryWrapper
- All Implemented Interfaces:
InternalInventory,ItemTransfer,Iterable<net.minecraft.world.item.ItemStack>
Wraps an inventory implementing the platforms standard inventory interface (i.e. IItemHandler on Forge) such that it
can be used as an
InternalInventory.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.item.ItemStackextractItem(int slot, int amount, boolean simulate) intgetSlotLimit(int slot) net.minecraft.world.item.ItemStackgetStackInSlot(int slotIndex) net.minecraft.world.item.ItemStackinsertItem(int slot, net.minecraft.world.item.ItemStack stack, boolean simulate) booleanisItemValid(int slot, net.minecraft.world.item.ItemStack stack) voidsetItemDirect(int slotIndex, net.minecraft.world.item.ItemStack stack) Puts the given stack in the given slot and circumvents any potential filters.intsize()net.neoforged.neoforge.items.IItemHandlerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface appeng.api.inventories.InternalInventory
addItems, addItems, clear, getRedstoneSignal, getSlotInv, getSubInventory, isEmpty, iterator, removeItems, removeSimilarItems, sendChangeNotification, simulateAdd, simulateRemove, simulateSimilarRemove, toContainerMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
PlatformInventoryWrapper
public PlatformInventoryWrapper(net.neoforged.neoforge.items.IItemHandler handler)
-
-
Method Details
-
toItemHandler
public net.neoforged.neoforge.items.IItemHandler toItemHandler()- Specified by:
toItemHandlerin interfaceInternalInventory
-
size
public int size()- Specified by:
sizein interfaceInternalInventory
-
getSlotLimit
public int getSlotLimit(int slot) - Specified by:
getSlotLimitin interfaceInternalInventory
-
getStackInSlot
public net.minecraft.world.item.ItemStack getStackInSlot(int slotIndex) - Specified by:
getStackInSlotin interfaceInternalInventory
-
setItemDirect
public void setItemDirect(int slotIndex, net.minecraft.world.item.ItemStack stack) Description copied from interface:InternalInventoryPuts the given stack in the given slot and circumvents any potential filters.- Specified by:
setItemDirectin interfaceInternalInventory
-
isItemValid
public boolean isItemValid(int slot, net.minecraft.world.item.ItemStack stack) - Specified by:
isItemValidin interfaceInternalInventory
-
insertItem
public net.minecraft.world.item.ItemStack insertItem(int slot, net.minecraft.world.item.ItemStack stack, boolean simulate) - Specified by:
insertItemin interfaceInternalInventory- Returns:
- The overflow
-
extractItem
public net.minecraft.world.item.ItemStack extractItem(int slot, int amount, boolean simulate) - Specified by:
extractItemin interfaceInternalInventory
-