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 boolean
areStacksEqual
(ItemStack left, ItemStack right) private static boolean
compareStacksUsingPredicate
(ItemStack left, ItemStack right) getTag()
boolean
isSimple()
static PartialNBTIngredient
of
(CompoundTag nbt, ItemLike... items) Creates a new ingredient matching any item from the list, containing the given NBTstatic PartialNBTIngredient
of
(ItemLike item, CompoundTag nbt) Creates a new ingredient matching the given item, containing the given NBTboolean
Returns 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, toNetwork
-
Field Details
-
CODEC
-
CODEC_NONEMPTY
-
-
Constructor Details
-
PartialNBTIngredient
-
-
Method Details
-
areStacksEqual
- Overrides:
areStacksEqual
in classIngredient
-
synchronizeWithContents
public boolean synchronizeWithContents()Description copied from class:Ingredient
Returns iftrue
, this ingredient will be synchronized using its contents, as in vanilla, otherwise it will be synchronized via thecodec
.- Overrides:
synchronizeWithContents
in 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:
isSimple
in classIngredient
-