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 boolean
areStacksEqual
(ItemStack left, ItemStack right) private static boolean
compareStacksWithNbt
(ItemStack left, ItemStack right) getStack()
boolean
isSimple()
static StrictNBTIngredient
Creates a new ingredient matching the given stack and tagboolean
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
-
-
Constructor Details
-
StrictNBTIngredient
-
-
Method Details
-
of
Creates a new ingredient matching the given stack and tag -
getStack
-
areStacksEqual
- Overrides:
areStacksEqual
in classIngredient
-
compareStacksWithNbt
-
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
-
isSimple
public boolean isSimple()- Overrides:
isSimple
in classIngredient
-