Class IntersectionIngredient
java.lang.Object
net.minecraft.world.item.crafting.Ingredient
net.neoforged.neoforge.common.crafting.IntersectionIngredient
Ingredient that matches if all child ingredients match
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.item.crafting.Ingredient
Ingredient.ItemValue, Ingredient.TagValue, Ingredient.Value
-
Field Summary
Modifier and TypeFieldDescriptionprivate final List<Ingredient>
static final com.mojang.serialization.Codec<IntersectionIngredient>
static final com.mojang.serialization.Codec<IntersectionIngredient>
Fields inherited from class net.minecraft.world.item.crafting.Ingredient
EMPTY, LIST_CODEC, LIST_CODEC_NONEMPTY, values, VANILLA_CODEC, VANILLA_CODEC_NONEMPTY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetItems()
boolean
isSimple()
static Ingredient
of
(Ingredient... ingredients) Gets an intersection ingredientboolean
Returns iftrue
, this ingredient will be synchronized using its contents, as in vanilla, otherwise it will be synchronized via thecodec
.boolean
Methods inherited from class net.minecraft.world.item.crafting.Ingredient
areStacksEqual, equals, fromJson, fromNetwork, fromValues, getStackingIds, getType, getValues, isEmpty, of, of, of, of, of, toJson, toNetwork
-
Field Details
-
CODEC
-
CODEC_NONEMPTY
-
children
-
-
Constructor Details
-
IntersectionIngredient
-
-
Method Details
-
getChildren
-
of
Gets an intersection ingredient- Parameters:
ingredients
- List of ingredients to match- Returns:
- Ingredient that only matches if all the passed ingredients match
-
getItems
- Overrides:
getItems
in classIngredient
-
test
- Specified by:
test
in interfacePredicate<ItemStack>
- Overrides:
test
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
-
isSimple
public boolean isSimple()- Overrides:
isSimple
in classIngredient
-