Class PartialNBTIngredient
java.lang.Object
net.minecraft.world.item.crafting.Ingredient
net.neoforged.neoforge.common.crafting.PartialNBTIngredient
Ingredient that matches the given items, performing a partial NBT match. Use
StrictNBTIngredient if you want exact match on NBT-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.item.crafting.Ingredient
Ingredient.ItemValue, Ingredient.TagValue, Ingredient.Value -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<PartialNBTIngredient>static final com.mojang.serialization.Codec<PartialNBTIngredient>Fields inherited from class net.minecraft.world.item.crafting.Ingredient
EMPTY, LIST_CODEC, LIST_CODEC_NONEMPTY, values, VANILLA_CODEC, VANILLA_CODEC_NONEMPTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanareStacksEqual(ItemStack left, ItemStack right) private static booleancompareStacksUsingPredicate(ItemStack left, ItemStack right) getTag()booleanisSimple()static PartialNBTIngredientof(CompoundTag nbt, ItemLike... items) Creates a new ingredient matching any item from the list, containing the given NBTstatic PartialNBTIngredientof(ItemLike item, CompoundTag nbt) Creates a new ingredient matching the given item, containing the given NBTbooleanReturns iftrue, this ingredient will be synchronized using its contents, as in vanilla, otherwise it will be synchronized via thecodec.Methods inherited from class net.minecraft.world.item.crafting.Ingredient
equals, fromJson, fromNetwork, fromValues, getItems, getStackingIds, getType, getValues, isEmpty, of, of, of, of, of, test, toJson, toNetwork
-
Field Details
-
CODEC
-
CODEC_NONEMPTY
-
-
Constructor Details
-
PartialNBTIngredient
-
-
Method Details
-
areStacksEqual
- Overrides:
areStacksEqualin classIngredient
-
synchronizeWithContents
public boolean synchronizeWithContents()Description copied from class:IngredientReturns iftrue, this ingredient will be synchronized using its contents, as in vanilla, otherwise it will be synchronized via thecodec.- Overrides:
synchronizeWithContentsin classIngredient- Returns:
- if
true, this ingredient will be synchronized using its contents, as in vanilla, otherwise it will be synchronized via thecodec
-
compareStacksUsingPredicate
-
of
Creates a new ingredient matching any item from the list, containing the given NBT -
of
Creates a new ingredient matching the given item, containing the given NBT -
getContainedItems
-
getTag
-
isSimple
public boolean isSimple()- Overrides:
isSimplein classIngredient
-