Class StrictNBTIngredient
java.lang.Object
net.minecraft.world.item.crafting.Ingredient
net.neoforged.neoforge.common.crafting.StrictNBTIngredient
Ingredient that matches the given stack, performing an exact NBT match. Use
PartialNBTIngredient if you need partial match.-
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<StrictNBTIngredient>Fields inherited from class net.minecraft.world.item.crafting.Ingredient
CODEC_NONEMPTY, 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 booleancompareStacksWithNbt(ItemStack left, ItemStack right) getStack()booleanisSimple()static StrictNBTIngredientCreates a new ingredient matching the given stack and tagbooleanReturns 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
-
-
Constructor Details
-
StrictNBTIngredient
-
-
Method Details
-
of
Creates a new ingredient matching the given stack and tag -
getStack
-
areStacksEqual
- Overrides:
areStacksEqualin classIngredient
-
compareStacksWithNbt
-
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
-
isSimple
public boolean isSimple()- Overrides:
isSimplein classIngredient
-