Class CompoundIngredient
java.lang.Object
net.minecraft.world.item.crafting.Ingredient
net.neoforged.neoforge.common.crafting.CompoundIngredient
Ingredient that matches if any of the child ingredients match
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.item.crafting.Ingredient
Ingredient.ItemValue, Ingredient.TagValue
-
Field Summary
Modifier and TypeFieldDescriptionprivate final List<Ingredient>
static final com.mojang.serialization.Codec<CompoundIngredient>
static final com.mojang.serialization.Codec<CompoundIngredient>
static final com.mojang.serialization.Codec<CompoundIngredient>
static final com.mojang.serialization.Codec<CompoundIngredient>
private final boolean
private final boolean
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 TypeMethodDescription@NotNull List<Ingredient>
getItems()
it.unimi.dsi.fastutil.ints.IntList
boolean
isSimple()
static Ingredient
of
(Ingredient... children) Creates a compound ingredient from the given list of ingredientsboolean
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, getType, getValues, isEmpty, of, of, of, of, of, toJson, toNetwork
-
Field Details
-
CODEC
-
DIRECT_CODEC
-
CODEC_NONEMPTY
-
DIRECT_CODEC_NONEMPTY
-
children
-
isSimple
private final boolean isSimple -
synchronizeWithContents
private final boolean synchronizeWithContents
-
-
Constructor Details
-
CompoundIngredient
-
-
Method Details
-
of
Creates a compound ingredient from the given list of ingredients -
getItems
- Overrides:
getItems
in classIngredient
-
test
- Specified by:
test
in interfacePredicate<ItemStack>
- Overrides:
test
in classIngredient
-
getStackingIds
public it.unimi.dsi.fastutil.ints.IntList getStackingIds()- Overrides:
getStackingIds
in classIngredient
-
isSimple
public boolean isSimple()- Overrides:
isSimple
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
-
getChildren
-