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.ItemStack
extractItem
(int slot, int amount, boolean simulate) int
getSlotLimit
(int slot) net.minecraft.world.item.ItemStack
getStackInSlot
(int slotIndex) net.minecraft.world.item.ItemStack
insertItem
(int slot, net.minecraft.world.item.ItemStack stack, boolean simulate) boolean
isItemValid
(int slot, net.minecraft.world.item.ItemStack stack) void
setItemDirect
(int slotIndex, net.minecraft.world.item.ItemStack stack) Puts the given stack in the given slot and circumvents any potential filters.int
size()
net.neoforged.neoforge.items.IItemHandler
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface appeng.api.inventories.InternalInventory
addItems, addItems, clear, getRedstoneSignal, getSlotInv, getSubInventory, isEmpty, iterator, removeItems, removeSimilarItems, sendChangeNotification, simulateAdd, simulateRemove, simulateSimilarRemove, toContainer
Methods 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:
toItemHandler
in interfaceInternalInventory
-
size
public int size()- Specified by:
size
in interfaceInternalInventory
-
getSlotLimit
public int getSlotLimit(int slot) - Specified by:
getSlotLimit
in interfaceInternalInventory
-
getStackInSlot
public net.minecraft.world.item.ItemStack getStackInSlot(int slotIndex) - Specified by:
getStackInSlot
in interfaceInternalInventory
-
setItemDirect
public void setItemDirect(int slotIndex, net.minecraft.world.item.ItemStack stack) Description copied from interface:InternalInventory
Puts the given stack in the given slot and circumvents any potential filters.- Specified by:
setItemDirect
in interfaceInternalInventory
-
isItemValid
public boolean isItemValid(int slot, net.minecraft.world.item.ItemStack stack) - Specified by:
isItemValid
in interfaceInternalInventory
-
insertItem
public net.minecraft.world.item.ItemStack insertItem(int slot, net.minecraft.world.item.ItemStack stack, boolean simulate) - Specified by:
insertItem
in interfaceInternalInventory
- Returns:
- The overflow
-
extractItem
public net.minecraft.world.item.ItemStack extractItem(int slot, int amount, boolean simulate) - Specified by:
extractItem
in interfaceInternalInventory
-