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>
  • Constructor Details

    • WorldlyContainerInventoryAccess

      public WorldlyContainerInventoryAccess(T internal)
  • Method Details

    • getAvailableSlots

      public int[] getAvailableSlots(net.minecraft.core.Direction side)
      Description copied from interface: IInventoryAccess
      Gets an array of accessible slot IDs for a given side of the inventory.
      Specified by:
      getAvailableSlots in interface IInventoryAccess
      Overrides:
      getAvailableSlots in class ContainerInventoryAccess<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: IInventoryAccess
      Attempts to insert an ItemStack into the given slot. If the ItemStack will not fully fit a partial insertion will be done instead.
      Specified by:
      insert in interface IInventoryAccess
      Overrides:
      insert in class ContainerInventoryAccess<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: IInventoryAccess
      Attempts 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:
      extract in interface IInventoryAccess
      Overrides:
      extract in class ContainerInventoryAccess<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.