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
ConstructorsModifierConstructorDescriptionprotectedEmpty constructor, for the sake of dynamic ingredientsprotectedAbstractIngredient(Stream<? extends Ingredient.Value> values) Value constructor, for ingredients that have some vanilla representation -
Method Summary
Modifier and TypeMethodDescriptionstatic IngredientfromJson(@Nullable com.google.gson.JsonElement json) Deprecated.static IngredientfromNetwork(FriendlyByteBuf buffer) Deprecated.static IngredientfromValues(Stream<? extends Ingredient.Value> values) Deprecated.abstract IIngredientSerializer<? extends Ingredient>abstract booleanisSimple()static Ingredientof()Deprecated.useIngredient.of()static IngredientDeprecated.useIngredient.of(Stream)(Stream)}static IngredientDeprecated.useIngredient.of(TagKey)(Stream)}static IngredientDeprecated.useIngredient.of(ItemStack...)(Stream)}static IngredientDeprecated.useIngredient.of(ItemLike...)(Stream)}abstract com.google.gson.JsonElementtoJson()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:
isSimplein classIngredient
-
getSerializer
- Overrides:
getSerializerin classIngredient
-
toJson
public abstract com.google.gson.JsonElement toJson()- Overrides:
toJsonin 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)}