Class InventoryHelper

java.lang.Object
vazkii.botania.common.helper.InventoryHelper

public class InventoryHelper extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    checkEmpty(net.minecraft.world.item.ItemStack remainder)
     
    static boolean
    containsType(net.minecraft.world.entity.player.Inventory inventory, net.minecraft.world.item.Item item)
    Replicates pre-1.20 behavior of Inventory.contains(ItemStack), i.e.
    static boolean
    overrideOtherStackedOnMe(Function<net.minecraft.world.item.ItemStack,net.minecraft.world.Container> inventoryGetter, boolean selfGuiOpen, @NotNull net.minecraft.world.item.ItemStack container, @NotNull net.minecraft.world.item.ItemStack toInsert, @NotNull net.minecraft.world.inventory.ClickAction clickAction, @NotNull net.minecraft.world.entity.SlotAccess cursorAccess)
     
    static boolean
    overrideStackedOnOther(Function<net.minecraft.world.item.ItemStack,net.minecraft.world.Container> inventoryGetter, boolean selfGuiOpen, @NotNull net.minecraft.world.item.ItemStack container, @NotNull net.minecraft.world.inventory.Slot slot, @NotNull net.minecraft.world.inventory.ClickAction clickAction, @NotNull net.minecraft.world.entity.player.Player player)
     
    static net.minecraft.world.item.ItemStack
    simulateTransfer(net.minecraft.world.Container to, net.minecraft.world.item.ItemStack stack, @Nullable net.minecraft.core.Direction side)
     
    static boolean
    tryToSetLastRecipe(net.minecraft.world.entity.player.Player player, net.minecraft.world.Container inv, @Nullable List<net.minecraft.world.item.ItemStack> lastRecipe, @Nullable net.minecraft.sounds.SoundEvent sound)
     
    static void
    withdrawFromInventory(SimpleInventoryBlockEntity inv, net.minecraft.world.entity.player.Player player)
     

    Methods inherited from class java.lang.Object

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

    • InventoryHelper

      public InventoryHelper()
  • Method Details

    • simulateTransfer

      public static net.minecraft.world.item.ItemStack simulateTransfer(net.minecraft.world.Container to, net.minecraft.world.item.ItemStack stack, @Nullable @Nullable net.minecraft.core.Direction side)
    • withdrawFromInventory

      public static void withdrawFromInventory(SimpleInventoryBlockEntity inv, net.minecraft.world.entity.player.Player player)
    • overrideStackedOnOther

      public static boolean overrideStackedOnOther(Function<net.minecraft.world.item.ItemStack,net.minecraft.world.Container> inventoryGetter, boolean selfGuiOpen, @NotNull @NotNull net.minecraft.world.item.ItemStack container, @NotNull @NotNull net.minecraft.world.inventory.Slot slot, @NotNull @NotNull net.minecraft.world.inventory.ClickAction clickAction, @NotNull @NotNull net.minecraft.world.entity.player.Player player)
    • overrideOtherStackedOnMe

      public static boolean overrideOtherStackedOnMe(Function<net.minecraft.world.item.ItemStack,net.minecraft.world.Container> inventoryGetter, boolean selfGuiOpen, @NotNull @NotNull net.minecraft.world.item.ItemStack container, @NotNull @NotNull net.minecraft.world.item.ItemStack toInsert, @NotNull @NotNull net.minecraft.world.inventory.ClickAction clickAction, @NotNull @NotNull net.minecraft.world.entity.SlotAccess cursorAccess)
    • checkEmpty

      public static void checkEmpty(net.minecraft.world.item.ItemStack remainder)
    • tryToSetLastRecipe

      public static boolean tryToSetLastRecipe(net.minecraft.world.entity.player.Player player, net.minecraft.world.Container inv, @Nullable @Nullable List<net.minecraft.world.item.ItemStack> lastRecipe, @Nullable @Nullable net.minecraft.sounds.SoundEvent sound)
    • containsType

      public static boolean containsType(net.minecraft.world.entity.player.Inventory inventory, net.minecraft.world.item.Item item)
      Replicates pre-1.20 behavior of Inventory.contains(ItemStack), i.e. only matching item type.
      Parameters:
      inventory - The Inventory.
      item - The item to match.
      Returns:
      true if the inventory contains an item of the specified type, otherwise false.