Class DifferenceIngredient
java.lang.Object
net.minecraft.world.item.crafting.Ingredient
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.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()getItems()it.unimi.dsi.fastutil.ints.IntListbooleanisSimple()static DifferenceIngredientof(Ingredient base, Ingredient subtracted) Gets the difference from the two ingredientsbooleanReturns iftrue, this ingredient will be synchronized using its contents, as in vanilla, otherwise it will be synchronized via thecodec.booleanMethods 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
-
CODEC_NONEMPTY
-
base
-
subtracted
-
-
Constructor Details
-
DifferenceIngredient
-
-
Method Details
-
getBase
-
getSubtracted
-
isSimple
public boolean isSimple()- Overrides:
isSimplein classIngredient
-
getItems
- Overrides:
getItemsin classIngredient
-
test
- Specified by:
testin interfacePredicate<ItemStack>- Overrides:
testin classIngredient
-
getStackingIds
public it.unimi.dsi.fastutil.ints.IntList getStackingIds()- Overrides:
getStackingIdsin classIngredient
-
synchronizeWithContents
public boolean synchronizeWithContents()Description copied from class:IngredientReturns iftrue, this ingredient will be synchronized using its contents, as in vanilla, otherwise it will be synchronized via thecodec.- Overrides:
synchronizeWithContentsin classIngredient- Returns:
- if
true, this ingredient will be synchronized using its contents, as in vanilla, otherwise it will be synchronized via thecodec
-
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
-