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 record
Nested classes/interfaces inherited from class net.minecraft.world.item.crafting.Ingredient
Ingredient.ItemValue, Ingredient.TagValue, Ingredient.Value
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Ingredient
static final com.mojang.serialization.Codec<DifferenceIngredient>
static final com.mojang.serialization.Codec<DifferenceIngredient>
private final Ingredient
Fields inherited from class net.neoforged.neoforge.common.crafting.ChildBasedIngredient
children
Fields inherited from class net.minecraft.world.item.crafting.Ingredient
EMPTY, LIST_CODEC, LIST_CODEC_NONEMPTY, values, VANILLA_CODEC, VANILLA_CODEC_NONEMPTY
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DifferenceIngredient
(Ingredient base, Ingredient subtracted) -
Method Summary
Modifier and TypeMethodDescriptiongetBase()
static DifferenceIngredient
of
(Ingredient base, Ingredient subtracted) Gets the difference from the two ingredientsprotected boolean
testComplex
(@Nullable ItemStack stack) Methods inherited from class net.neoforged.neoforge.common.crafting.ChildBasedIngredient
getChildren, getItems, isSimple, synchronizeWithContents, test
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
-
CODEC
-
CODEC_NONEMPTY
-
base
-
subtracted
-
-
Constructor Details
-
DifferenceIngredient
-
-
Method Details
-
getBase
-
getSubtracted
-
generateMatchingStacks
- Specified by:
generateMatchingStacks
in classChildBasedIngredient
-
testComplex
- Specified by:
testComplex
in 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
base
anything in base that is not insubtracted
-