Class InventoryUtils

java.lang.Object
com.ldtteam.structurize.util.InventoryUtils

public class InventoryUtils extends Object
Structurize specific inventory utilities.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    consumeStack(net.minecraft.world.item.ItemStack tempStack, net.minecraftforge.items.IItemHandler handler)
    Consume an ItemStack from an itemhandler.
    static boolean
    hasRequiredItems(net.minecraftforge.items.IItemHandler inventory, List<net.minecraft.world.item.ItemStack> requiredItems)
    Check if an inventory has all the required stacks.
    static void
    transferIntoNextBestSlot(net.minecraft.world.item.ItemStack stack, net.minecraftforge.items.IItemHandler targetHandler)
    Method to transfers a stack to the next best slot in the target inventory.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • InventoryUtils

      public InventoryUtils()
  • Method Details

    • hasRequiredItems

      public static boolean hasRequiredItems(net.minecraftforge.items.IItemHandler inventory, List<net.minecraft.world.item.ItemStack> requiredItems)
      Check if an inventory has all the required stacks.
      Parameters:
      inventory - the inventory to check.
      requiredItems - the list of items.
      Returns:
      true if so, else false.
    • transferIntoNextBestSlot

      public static void transferIntoNextBestSlot(net.minecraft.world.item.ItemStack stack, net.minecraftforge.items.IItemHandler targetHandler)
      Method to transfers a stack to the next best slot in the target inventory.
      Parameters:
      targetHandler - The IItemHandler that works as Target.
    • consumeStack

      public static void consumeStack(net.minecraft.world.item.ItemStack tempStack, net.minecraftforge.items.IItemHandler handler)
      Consume an ItemStack from an itemhandler.
      Parameters:
      tempStack - the stack.
      handler - the handler.