Class ComponentIngredient

java.lang.Object
net.minecraft.world.item.crafting.Ingredient
net.minecraftforge.common.crafting.ingredients.AbstractIngredient
com.stereowalker.unionlib.forge.ComponentIngredient
All Implemented Interfaces:
Predicate<net.minecraft.world.item.ItemStack>

public class ComponentIngredient extends net.minecraftforge.common.crafting.ingredients.AbstractIngredient
Ingredient that matches the given items, performing a partial NBT match unless strict is set.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

    Nested classes/interfaces inherited from class net.minecraft.world.item.crafting.Ingredient

    net.minecraft.world.item.crafting.Ingredient.ItemValue, net.minecraft.world.item.crafting.Ingredient.TagValue, net.minecraft.world.item.crafting.Ingredient.Value
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.MapCodec<ComponentIngredient>
     
    static final net.minecraftforge.common.crafting.ingredients.IIngredientSerializer<ComponentIngredient>
     

    Fields inherited from class net.minecraft.world.item.crafting.Ingredient

    CODEC_NONEMPTY, CONTENTS_STREAM_CODEC, EMPTY, VANILLA_CODEC, VANILLA_MAP_CODEC
  • Method Summary

    Modifier and Type
    Method
    Description
     
    boolean
     
    of(List<net.minecraft.world.item.Item> items, net.minecraft.core.component.DataComponentPatch nbt)
    Creates a new ingredient matching the given item, containing the given NBT
    of(List<net.minecraft.world.item.Item> items, net.minecraft.core.component.DataComponentPatch nbt, boolean strict)
     
    of(net.minecraft.core.component.DataComponentPatch nbt, net.minecraft.world.level.ItemLike... items)
    Creates a new ingredient matching any item from the list, containing the given NBT
    of(net.minecraft.world.level.ItemLike item, net.minecraft.core.component.DataComponentPatch nbt)
    Creates a new ingredient matching the given item, containing the given NBT
    of(net.minecraft.world.level.ItemLike item, net.minecraft.core.component.DataComponentPatch nbt, boolean strict)
     
    net.minecraftforge.common.crafting.ingredients.IIngredientSerializer<? extends net.minecraft.world.item.crafting.Ingredient>
     
    boolean
    test(net.minecraft.world.item.ItemStack stack)
     

    Methods inherited from class net.minecraftforge.common.crafting.ingredients.AbstractIngredient

    fromValues, of, of, of, of, of

    Methods inherited from class net.minecraft.world.item.crafting.Ingredient

    checkInvalidation, equals, getItems, getStackingIds, invalidate, invalidateAll, isEmpty, isVanilla, markValid, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.util.function.Predicate

    and, negate, or
  • Field Details

    • CODEC

      public static final com.mojang.serialization.MapCodec<ComponentIngredient> CODEC
    • SERIALIZER

      public static final net.minecraftforge.common.crafting.ingredients.IIngredientSerializer<ComponentIngredient> SERIALIZER
  • Method Details

    • builder

      public static ComponentIngredient.Builder builder()
    • of

      public static ComponentIngredient of(net.minecraft.core.component.DataComponentPatch nbt, net.minecraft.world.level.ItemLike... items)
      Creates a new ingredient matching any item from the list, containing the given NBT
    • of

      public static ComponentIngredient of(net.minecraft.world.level.ItemLike item, net.minecraft.core.component.DataComponentPatch nbt)
      Creates a new ingredient matching the given item, containing the given NBT
    • of

      public static ComponentIngredient of(net.minecraft.world.level.ItemLike item, net.minecraft.core.component.DataComponentPatch nbt, boolean strict)
    • of

      public static ComponentIngredient of(List<net.minecraft.world.item.Item> items, net.minecraft.core.component.DataComponentPatch nbt)
      Creates a new ingredient matching the given item, containing the given NBT
    • of

      public static ComponentIngredient of(List<net.minecraft.world.item.Item> items, net.minecraft.core.component.DataComponentPatch nbt, boolean strict)
    • test

      public boolean test(net.minecraft.world.item.ItemStack stack)
      Specified by:
      test in interface Predicate<net.minecraft.world.item.ItemStack>
      Overrides:
      test in class net.minecraft.world.item.crafting.Ingredient
    • isSimple

      public boolean isSimple()
      Specified by:
      isSimple in class net.minecraftforge.common.crafting.ingredients.AbstractIngredient
    • serializer

      public net.minecraftforge.common.crafting.ingredients.IIngredientSerializer<? extends net.minecraft.world.item.crafting.Ingredient> serializer()
      Specified by:
      serializer in class net.minecraftforge.common.crafting.ingredients.AbstractIngredient