Class ChildBasedIngredient
java.lang.Object
net.minecraft.world.item.crafting.Ingredient
net.neoforged.neoforge.common.crafting.ChildBasedIngredient
- Direct Known Subclasses:
CompoundIngredient
,DifferenceIngredient
,IntersectionIngredient
Intermediary class for easing handling of ingredients that make use of multiple children
-
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 TypeFieldDescriptionprotected final List<Ingredient>
private @Nullable ItemStack[]
private final boolean
private final boolean
Fields inherited from class net.minecraft.world.item.crafting.Ingredient
CODEC, CODEC_NONEMPTY, EMPTY, LIST_CODEC, LIST_CODEC_NONEMPTY, values, VANILLA_CODEC, VANILLA_CODEC_NONEMPTY
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ChildBasedIngredient
(Stream<? extends Ingredient.Value> values, Supplier<? extends IngredientType<?>> type, List<Ingredient> children) -
Method Summary
Modifier and TypeMethodDescriptionfinal List<Ingredient>
final ItemStack[]
getItems()
final boolean
isSimple()
final boolean
Returns iftrue
, this ingredient will be synchronized using its contents, as in vanilla, otherwise it will be synchronized via thecodec
.final boolean
protected abstract boolean
testComplex
(@Nullable ItemStack stack) Methods inherited from class net.minecraft.world.item.crafting.Ingredient
areStacksEqual, equals, fromJson, fromNetwork, fromValues, getStackingIds, getType, getValues, isEmpty, of, of, of, of, of, toNetwork
-
Field Details
-
children
-
isSimple
private final boolean isSimple -
synchronizeWithContents
private final boolean synchronizeWithContents -
filteredMatchingStacks
-
-
Constructor Details
-
ChildBasedIngredient
protected ChildBasedIngredient(Stream<? extends Ingredient.Value> values, Supplier<? extends IngredientType<?>> type, List<Ingredient> children)
-
-
Method Details
-
generateMatchingStacks
-
testComplex
-
getItems
- Overrides:
getItems
in classIngredient
-
test
- Specified by:
test
in interfacePredicate<ItemStack>
- Overrides:
test
in classIngredient
-
isSimple
public final boolean isSimple()- Overrides:
isSimple
in classIngredient
-
synchronizeWithContents
public final 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
-