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>, net.minecraft.world.entity.player.StackedContents.IngredientInfo<net.minecraft.core.Holder<net.minecraft.world.item.Item>>

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 
     
  • 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

    CONTENTS_STREAM_CODEC, NON_AIR_HOLDER_SET_CODEC, OPTIONAL_CONTENTS_STREAM_CODEC, values, VANILLA_SERIALIZER
  • Method Summary

    Modifier and Type
    Method
    Description
     
    boolean
     
    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.core.HolderSet<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(net.minecraft.core.HolderSet<net.minecraft.world.item.Item> items, net.minecraft.core.component.DataComponentPatch nbt, boolean strict)
     
    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

    acceptsItem, isEmpty, of, of, of, of

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

    display, equals, hashCode, isVanilla, items, of, of, of, optionalIngredientToDisplay, testOptionalIngredient, toString

    Methods inherited from class Object

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

    Methods inherited from interface 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(net.minecraft.core.HolderSet<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(net.minecraft.core.HolderSet<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