Class DifferenceIngredient
java.lang.Object
net.minecraft.world.item.crafting.Ingredient
net.minecraftforge.common.crafting.ingredients.AbstractIngredient
net.minecraftforge.common.crafting.ingredients.DifferenceIngredient
Ingredient that matches everything from the first ingredient that is not included in the second ingredient
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.item.crafting.Ingredient
Ingredient.ItemValue, Ingredient.TagValue, Ingredient.Value
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Ingredient
static final com.mojang.serialization.Codec<DifferenceIngredient>
private ItemStack[]
private it.unimi.dsi.fastutil.ints.IntList
static final IIngredientSerializer<DifferenceIngredient>
private final Ingredient
Fields inherited from class net.minecraft.world.item.crafting.Ingredient
CODEC_NONEMPTY, EMPTY, VANILLA_CODEC
-
Constructor Summary
ModifierConstructorDescriptionprivate
DifferenceIngredient
(Ingredient base, Ingredient subtracted) -
Method Summary
Modifier and TypeMethodDescriptiongetItems()
it.unimi.dsi.fastutil.ints.IntList
protected void
boolean
isEmpty()
boolean
isSimple()
static DifferenceIngredient
of
(Ingredient base, Ingredient subtracted) Gets the difference from the two ingredientsboolean
Methods inherited from class net.minecraftforge.common.crafting.ingredients.AbstractIngredient
fromNetwork, fromValues, of, of, of, of, of
Methods inherited from class net.minecraft.world.item.crafting.Ingredient
checkInvalidation, equals, invalidateAll, isVanilla, markValid, toNetwork, toString
-
Field Details
-
base
-
subtracted
-
filteredMatchingStacks
-
packedMatchingStacks
private it.unimi.dsi.fastutil.ints.IntList packedMatchingStacks -
CODEC
-
SERIALIZER
-
-
Constructor Details
-
DifferenceIngredient
-
-
Method Details
-
of
Gets the difference from the two ingredients- Parameters:
base
- Ingredient the item must matchsubtracted
- Ingredient the item must not match- Returns:
- Ingredient that matches anything in
base
that is not insubtracted
-
test
- Specified by:
test
in interfacePredicate<ItemStack>
- Overrides:
test
in classIngredient
-
getItems
- Overrides:
getItems
in classIngredient
-
isEmpty
public boolean isEmpty()- Overrides:
isEmpty
in classIngredient
-
isSimple
public boolean isSimple()- Specified by:
isSimple
in classAbstractIngredient
-
invalidate
protected void invalidate()- Overrides:
invalidate
in classIngredient
-
getStackingIds
public it.unimi.dsi.fastutil.ints.IntList getStackingIds()- Overrides:
getStackingIds
in classIngredient
-
serializer
- Specified by:
serializer
in classAbstractIngredient
-