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 final boolean
    equalIgnoringComponents(net.minecraft.world.item.ItemStack stack1, net.minecraft.world.item.ItemStack stack2, Predicate<net.minecraft.core.component.DataComponentType<?>> ignoredComponentTypes)
     
    static final boolean
    equalIgnoringComponents(net.minecraft.world.item.ItemStack stack1, net.minecraft.world.item.ItemStack stack2, net.minecraft.core.component.DataComponentType<?>... ignoredComponentTypes)
     
    static final boolean
    equalIgnoringComponents(net.minecraft.world.item.ItemStack stack1, net.minecraft.world.item.ItemStack stack2, net.minecraft.tags.TagKey<net.minecraft.core.component.DataComponentType<?>> ignoredComponentTypesTag)
     
    static final net.minecraft.world.entity.item.ItemEntity
    getItemEntityToPop(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.item.ItemStack stack)
     
    static final <T> Optional<T>
    getOptional(net.minecraft.world.item.ItemStack stack, net.minecraft.core.component.DataComponentType<T> componentType)
     
    static final void
    give(net.minecraft.world.entity.Entity entity, Stream<net.minecraft.world.item.ItemStack> stacks)
     
    static final void
    pop(net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 position, net.minecraft.world.item.ItemStack stack)
     
    static final 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 final <T> Optional<T> getOptional(net.minecraft.world.item.ItemStack stack, net.minecraft.core.component.DataComponentType<T> componentType)
    • equalIgnoringComponents

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

      public static final boolean equalIgnoringComponents(net.minecraft.world.item.ItemStack stack1, net.minecraft.world.item.ItemStack stack2, net.minecraft.tags.TagKey<net.minecraft.core.component.DataComponentType<?>> ignoredComponentTypesTag)
    • equalIgnoringComponents

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

      public static final net.minecraft.world.entity.item.ItemEntity getItemEntityToPop(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.item.ItemStack stack)
    • pop

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

      public static final 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 final void give(net.minecraft.world.entity.Entity entity, Stream<net.minecraft.world.item.ItemStack> stacks)