Class ItemHelper

java.lang.Object
com.petrolpark.util.ItemHelper

public class ItemHelper extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    equalIgnoringComponents(net.minecraft.world.item.ItemStack stack1, net.minecraft.world.item.ItemStack stack2, net.minecraft.core.component.DataComponentType<?>... ignoredComponentTypes)
     
    static <T> Optional<T>
    getOptional(net.minecraft.world.item.ItemStack stack, net.minecraft.core.component.DataComponentType<T> componentType)
     
    static void
    give(net.minecraft.world.entity.Entity entity, Stream<net.minecraft.world.item.ItemStack> stacks)
     
    static void
    pop(net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 position, net.minecraft.world.item.ItemStack stack)
     
    static int
    removeItems(net.neoforged.neoforge.items.IItemHandler inv, Predicate<net.minecraft.world.item.ItemStack> test, int maxCount)
     

    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

    • getOptional

      public static <T> Optional<T> getOptional(net.minecraft.world.item.ItemStack stack, net.minecraft.core.component.DataComponentType<T> componentType)
    • equalIgnoringComponents

      public static boolean equalIgnoringComponents(net.minecraft.world.item.ItemStack stack1, net.minecraft.world.item.ItemStack stack2, net.minecraft.core.component.DataComponentType<?>... ignoredComponentTypes)
    • pop

      public static void pop(net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 position, net.minecraft.world.item.ItemStack stack)
    • removeItems

      public static int removeItems(net.neoforged.neoforge.items.IItemHandler inv, Predicate<net.minecraft.world.item.ItemStack> test, int maxCount)
      Parameters:
      inv -
      test -
      maxCount -
      Returns:
      Actual number of actual Items removed
    • give

      public static void give(net.minecraft.world.entity.Entity entity, Stream<net.minecraft.world.item.ItemStack> stacks)