Class DifferenceIngredient
java.lang.Object
net.minecraft.world.item.crafting.Ingredient
net.neoforged.neoforge.common.crafting.ChildBasedIngredient
net.neoforged.neoforge.common.crafting.DifferenceIngredient
Ingredient that matches everything from the first ingredient that is not included in the second ingredient
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final recordNested classes/interfaces inherited from class net.minecraft.world.item.crafting.Ingredient
Ingredient.ItemValue, Ingredient.TagValue, Ingredient.Value -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Ingredientstatic final com.mojang.serialization.Codec<DifferenceIngredient>static final com.mojang.serialization.Codec<DifferenceIngredient>private final IngredientFields inherited from class net.neoforged.neoforge.common.crafting.ChildBasedIngredient
childrenFields inherited from class net.minecraft.world.item.crafting.Ingredient
EMPTY, LIST_CODEC, LIST_CODEC_NONEMPTY, values, VANILLA_CODEC, VANILLA_CODEC_NONEMPTY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDifferenceIngredient(Ingredient base, Ingredient subtracted) -
Method Summary
Modifier and TypeMethodDescriptiongetBase()static DifferenceIngredientof(Ingredient base, Ingredient subtracted) Gets the difference from the two ingredientsprotected booleantestComplex(@Nullable ItemStack stack) Methods inherited from class net.neoforged.neoforge.common.crafting.ChildBasedIngredient
getChildren, getItems, isSimple, synchronizeWithContents, testMethods 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
-
CODEC
-
CODEC_NONEMPTY
-
base
-
subtracted
-
-
Constructor Details
-
DifferenceIngredient
-
-
Method Details
-
getBase
-
getSubtracted
-
generateMatchingStacks
- Specified by:
generateMatchingStacksin classChildBasedIngredient
-
testComplex
- Specified by:
testComplexin classChildBasedIngredient
-
of
Gets the difference from the two ingredients- Parameters:
base- Ingredient the item must matchsubtracted- Ingredient the item must not match- Returns:
- Ingredient that
baseanything in base that is not insubtracted
-