Class AbstractIngredient
java.lang.Object
net.minecraft.world.item.crafting.Ingredient
net.minecraftforge.common.crafting.AbstractIngredient
- Direct Known Subclasses:
CompoundIngredient
,DifferenceIngredient
,IntersectionIngredient
,PartialNBTIngredient
,StrictNBTIngredient
Extension of
Ingredient
which makes most methods custom ingredients need to implement abstract, and removes the static constructors
Mods are encouraged to extend this class for their custom ingredients-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.item.crafting.Ingredient
Ingredient.ItemValue, Ingredient.TagValue, Ingredient.Value
-
Field Summary
Fields inherited from class net.minecraft.world.item.crafting.Ingredient
EMPTY
-
Constructor Summary
ModifierConstructorDescriptionprotected
Empty constructor, for the sake of dynamic ingredientsprotected
AbstractIngredient
(Stream<? extends Ingredient.Value> values) Value constructor, for ingredients that have some vanilla representation -
Method Summary
Modifier and TypeMethodDescriptionstatic Ingredient
fromJson
(@Nullable com.google.gson.JsonElement json) Deprecated.static Ingredient
fromNetwork
(FriendlyByteBuf buffer) Deprecated.static Ingredient
fromValues
(Stream<? extends Ingredient.Value> values) Deprecated.abstract IIngredientSerializer<? extends Ingredient>
abstract boolean
isSimple()
static Ingredient
of()
Deprecated.useIngredient.of()
static Ingredient
Deprecated.useIngredient.of(Stream)
(Stream)}static Ingredient
Deprecated.useIngredient.of(TagKey)
(Stream)}static Ingredient
Deprecated.useIngredient.of(ItemStack...)
(Stream)}static Ingredient
Deprecated.useIngredient.of(ItemLike...)
(Stream)}abstract com.google.gson.JsonElement
toJson()
Methods inherited from class net.minecraft.world.item.crafting.Ingredient
checkInvalidation, getItems, getStackingIds, invalidate, invalidateAll, isEmpty, isVanilla, markValid, merge, test, toNetwork, valueFromJson
-
Constructor Details
-
AbstractIngredient
protected AbstractIngredient()Empty constructor, for the sake of dynamic ingredients -
AbstractIngredient
Value constructor, for ingredients that have some vanilla representation
-
-
Method Details
-
isSimple
public abstract boolean isSimple()- Overrides:
isSimple
in classIngredient
-
getSerializer
- Overrides:
getSerializer
in classIngredient
-
toJson
public abstract com.google.gson.JsonElement toJson()- Overrides:
toJson
in classIngredient
-
fromValues
Deprecated. -
of
Deprecated.useIngredient.of()
-
of
Deprecated.useIngredient.of(ItemLike...)
(Stream)} -
of
Deprecated.useIngredient.of(ItemStack...)
(Stream)} -
of
Deprecated.useIngredient.of(Stream)
(Stream)} -
of
Deprecated.useIngredient.of(TagKey)
(Stream)} -
fromNetwork
Deprecated. -
fromJson
Deprecated.useIngredient.fromJson(JsonElement)
(Stream)}
-
Ingredient.fromJson(JsonElement)
(Stream)}