Class WorldlyContainerInventoryAccess<T extends net.minecraft.world.WorldlyContainer>
java.lang.Object
net.darkhax.bookshelf.api.inventory.ContainerInventoryAccess<T>
net.darkhax.bookshelf.api.inventory.WorldlyContainerInventoryAccess<T>
- All Implemented Interfaces:
IInventoryAccess
public class WorldlyContainerInventoryAccess<T extends net.minecraft.world.WorldlyContainer>
extends ContainerInventoryAccess<T>
-
Field Summary
Fields inherited from class net.darkhax.bookshelf.api.inventory.ContainerInventoryAccess
internal -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.item.ItemStackextract(int slot, int amount, net.minecraft.core.Direction side, boolean modify) Attempts to extract items from the specified amount.int[]getAvailableSlots(net.minecraft.core.Direction side) Gets an array of accessible slot IDs for a given side of the inventory.net.minecraft.world.item.ItemStackinsert(int slot, net.minecraft.world.item.ItemStack insertStack, net.minecraft.core.Direction side, boolean modify) Attempts to insert an ItemStack into the given slot.Methods inherited from class net.darkhax.bookshelf.api.inventory.ContainerInventoryAccess
getSlotSize, getStackInSlot, insert, isValidForSlot, updateSlotMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.darkhax.bookshelf.api.inventory.IInventoryAccess
canExtract, canExtract, canInsert, canInsert, extract, extract, forEachSlot, getAvailableSlots, insert, insert, isValidForSlot
-
Constructor Details
-
WorldlyContainerInventoryAccess
-
-
Method Details
-
getAvailableSlots
public int[] getAvailableSlots(net.minecraft.core.Direction side) Description copied from interface:IInventoryAccessGets an array of accessible slot IDs for a given side of the inventory.- Specified by:
getAvailableSlotsin interfaceIInventoryAccess- Overrides:
getAvailableSlotsin classContainerInventoryAccess<T extends net.minecraft.world.WorldlyContainer>- Parameters:
side- The side of the inventory being accessed. This is only relevant when accessing directional inventories.- Returns:
- An array of accessible slot IDs.
-
insert
public net.minecraft.world.item.ItemStack insert(int slot, net.minecraft.world.item.ItemStack insertStack, net.minecraft.core.Direction side, boolean modify) Description copied from interface:IInventoryAccessAttempts to insert an ItemStack into the given slot. If the ItemStack will not fully fit a partial insertion will be done instead.- Specified by:
insertin interfaceIInventoryAccess- Overrides:
insertin classContainerInventoryAccess<T extends net.minecraft.world.WorldlyContainer>- Parameters:
slot- The ID of the slot to insert into.insertStack- The ItemStack to insert.side- The side of the inventory the item is being inserted through.modify- Should the contents of the inventory actually be modified?- Returns:
- The remaining ItemStack that was not inserted. An empty stack indicates that the item was fully inserted.
-
extract
public net.minecraft.world.item.ItemStack extract(int slot, int amount, net.minecraft.core.Direction side, boolean modify) Description copied from interface:IInventoryAccessAttempts to extract items from the specified amount. You are not guaranteed to receive an item or as many of the item as you requested.- Specified by:
extractin interfaceIInventoryAccess- Overrides:
extractin classContainerInventoryAccess<T extends net.minecraft.world.WorldlyContainer>- Parameters:
slot- The ID of the slot to extract from.amount- The amount of items to extract.side- The side the items are extracted from.modify- Should the contents of the inventory actually be modified?- Returns:
- The extracted items.
-