Package vazkii.botania.common.helper
Class InventoryHelper
java.lang.Object
vazkii.botania.common.helper.InventoryHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckEmpty(net.minecraft.world.item.ItemStack remainder) static booleancontainsType(net.minecraft.world.entity.player.Inventory inventory, net.minecraft.world.item.Item item) Replicates pre-1.20 behavior ofInventory.contains(ItemStack), i.e.static booleanoverrideOtherStackedOnMe(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 booleanoverrideStackedOnOther(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.ItemStacksimulateTransfer(net.minecraft.world.Container to, net.minecraft.world.item.ItemStack stack, @Nullable net.minecraft.core.Direction side) static booleantryToSetLastRecipe(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 voidwithdrawFromInventory(SimpleInventoryBlockEntity inv, net.minecraft.world.entity.player.Player player)
-
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 ofInventory.contains(ItemStack), i.e. only matching item type.- Parameters:
inventory- The Inventory.item- The item to match.- Returns:
trueif the inventory contains an item of the specified type, otherwisefalse.
-