Class ItemHelper

java.lang.Object
com.simibubi.create.foundation.item.ItemHelper

public class ItemHelper extends Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addToList(net.minecraft.world.item.ItemStack stack, List<net.minecraft.world.item.ItemStack> stacks)
     
    static <T extends IBE<? extends net.minecraft.world.level.block.entity.BlockEntity>>
    int
    calcRedstoneFromBlockEntity(T ibe, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
     
    static int
    calcRedstoneFromInventory(net.neoforged.neoforge.items.IItemHandler inv)
     
    static boolean
    canItemStackAmountsStack(net.minecraft.world.item.ItemStack a, net.minecraft.world.item.ItemStack b)
     
    static List<net.createmod.catnip.data.Pair<net.minecraft.world.item.crafting.Ingredient,org.apache.commons.lang3.mutable.MutableInt>>
    condenseIngredients(net.minecraft.core.NonNullList<net.minecraft.world.item.crafting.Ingredient> recipeIngredients)
     
    static net.minecraft.world.item.component.ItemContainerContents
    containerContentsFromHandler(net.neoforged.neoforge.items.ItemStackHandler handler)
     
    static void
    copyContents(net.neoforged.neoforge.items.IItemHandler from, net.neoforged.neoforge.items.IItemHandlerModifiable to)
     
    static void
    dropContents(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.neoforged.neoforge.items.IItemHandler inv)
     
    static net.minecraft.world.item.ItemStack
    extract(net.neoforged.neoforge.items.IItemHandler inv, Predicate<net.minecraft.world.item.ItemStack> test, boolean simulate)
     
    static net.minecraft.world.item.ItemStack
    extract(net.neoforged.neoforge.items.IItemHandler inv, Predicate<net.minecraft.world.item.ItemStack> test, int exactAmount, boolean simulate)
     
    static net.minecraft.world.item.ItemStack
    extract(net.neoforged.neoforge.items.IItemHandler inv, Predicate<net.minecraft.world.item.ItemStack> test, ItemHelper.ExtractionCountMode mode, int amount, boolean simulate)
     
    static net.minecraft.world.item.ItemStack
    extract(net.neoforged.neoforge.items.IItemHandler inv, Predicate<net.minecraft.world.item.ItemStack> test, Function<net.minecraft.world.item.ItemStack,Integer> amountFunction, boolean simulate)
     
    static void
    fillItemStackHandler(net.minecraft.world.item.component.ItemContainerContents contents, net.neoforged.neoforge.items.ItemStackHandler inv)
     
    static net.minecraft.world.item.ItemStack
    findFirstMatch(net.neoforged.neoforge.items.IItemHandler inv, Predicate<net.minecraft.world.item.ItemStack> test)
     
    static int
    findFirstMatchingSlotIndex(net.neoforged.neoforge.items.IItemHandler inv, Predicate<net.minecraft.world.item.ItemStack> test)
     
    static net.minecraft.world.item.ItemStack
    fromItemEntity(net.minecraft.world.entity.Entity entityIn)
     
    static boolean
    isSameInventory(net.neoforged.neoforge.items.IItemHandler h1, net.neoforged.neoforge.items.IItemHandler h2)
     
    static net.minecraft.world.item.ItemStack
    limitCountToMaxStackSize(net.minecraft.world.item.ItemStack stack, boolean simulate)
     
    static boolean
    matchAllIngredients(net.minecraft.core.NonNullList<net.minecraft.world.item.crafting.Ingredient> ingredients)
     
    static boolean
    matchIngredients(net.minecraft.world.item.crafting.Ingredient i1, net.minecraft.world.item.crafting.Ingredient i2)
     
    static List<net.minecraft.world.item.ItemStack>
    multipliedOutput(net.minecraft.world.item.ItemStack in, net.minecraft.world.item.ItemStack out)
     
    static boolean
    sameItem(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.ItemStack otherStack)
     
    static Predicate<net.minecraft.world.item.ItemStack>
    sameItemPredicate(net.minecraft.world.item.ItemStack stack)
     

    Methods inherited from class java.lang.Object

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

    • ItemHelper

      public ItemHelper()
  • Method Details

    • sameItem

      public static boolean sameItem(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.ItemStack otherStack)
    • sameItemPredicate

      public static Predicate<net.minecraft.world.item.ItemStack> sameItemPredicate(net.minecraft.world.item.ItemStack stack)
    • dropContents

      public static void dropContents(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.neoforged.neoforge.items.IItemHandler inv)
    • multipliedOutput

      public static List<net.minecraft.world.item.ItemStack> multipliedOutput(net.minecraft.world.item.ItemStack in, net.minecraft.world.item.ItemStack out)
    • addToList

      public static void addToList(net.minecraft.world.item.ItemStack stack, List<net.minecraft.world.item.ItemStack> stacks)
    • isSameInventory

      public static boolean isSameInventory(net.neoforged.neoforge.items.IItemHandler h1, net.neoforged.neoforge.items.IItemHandler h2)
    • calcRedstoneFromBlockEntity

      public static <T extends IBE<? extends net.minecraft.world.level.block.entity.BlockEntity>> int calcRedstoneFromBlockEntity(T ibe, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
    • calcRedstoneFromInventory

      public static int calcRedstoneFromInventory(@Nullable net.neoforged.neoforge.items.IItemHandler inv)
    • condenseIngredients

      public static List<net.createmod.catnip.data.Pair<net.minecraft.world.item.crafting.Ingredient,org.apache.commons.lang3.mutable.MutableInt>> condenseIngredients(net.minecraft.core.NonNullList<net.minecraft.world.item.crafting.Ingredient> recipeIngredients)
    • matchIngredients

      public static boolean matchIngredients(net.minecraft.world.item.crafting.Ingredient i1, net.minecraft.world.item.crafting.Ingredient i2)
    • matchAllIngredients

      public static boolean matchAllIngredients(net.minecraft.core.NonNullList<net.minecraft.world.item.crafting.Ingredient> ingredients)
    • extract

      public static net.minecraft.world.item.ItemStack extract(net.neoforged.neoforge.items.IItemHandler inv, Predicate<net.minecraft.world.item.ItemStack> test, boolean simulate)
    • extract

      public static net.minecraft.world.item.ItemStack extract(net.neoforged.neoforge.items.IItemHandler inv, Predicate<net.minecraft.world.item.ItemStack> test, int exactAmount, boolean simulate)
    • extract

      public static net.minecraft.world.item.ItemStack extract(net.neoforged.neoforge.items.IItemHandler inv, Predicate<net.minecraft.world.item.ItemStack> test, ItemHelper.ExtractionCountMode mode, int amount, boolean simulate)
    • extract

      public static net.minecraft.world.item.ItemStack extract(net.neoforged.neoforge.items.IItemHandler inv, Predicate<net.minecraft.world.item.ItemStack> test, Function<net.minecraft.world.item.ItemStack,Integer> amountFunction, boolean simulate)
    • canItemStackAmountsStack

      public static boolean canItemStackAmountsStack(net.minecraft.world.item.ItemStack a, net.minecraft.world.item.ItemStack b)
    • findFirstMatch

      public static net.minecraft.world.item.ItemStack findFirstMatch(net.neoforged.neoforge.items.IItemHandler inv, Predicate<net.minecraft.world.item.ItemStack> test)
    • findFirstMatchingSlotIndex

      public static int findFirstMatchingSlotIndex(net.neoforged.neoforge.items.IItemHandler inv, Predicate<net.minecraft.world.item.ItemStack> test)
    • fromItemEntity

      public static net.minecraft.world.item.ItemStack fromItemEntity(net.minecraft.world.entity.Entity entityIn)
    • fillItemStackHandler

      public static void fillItemStackHandler(net.minecraft.world.item.component.ItemContainerContents contents, net.neoforged.neoforge.items.ItemStackHandler inv)
    • containerContentsFromHandler

      public static net.minecraft.world.item.component.ItemContainerContents containerContentsFromHandler(net.neoforged.neoforge.items.ItemStackHandler handler)
    • limitCountToMaxStackSize

      public static net.minecraft.world.item.ItemStack limitCountToMaxStackSize(net.minecraft.world.item.ItemStack stack, boolean simulate)
    • copyContents

      public static void copyContents(net.neoforged.neoforge.items.IItemHandler from, net.neoforged.neoforge.items.IItemHandlerModifiable to)