Class AbstractIngredient
java.lang.Object
net.minecraft.world.item.crafting.Ingredient
io.github.tropheusj.serialization_hooks.ingredient.BaseCustomIngredient
io.github.vampirestudios.vampirelib.crafting.AbstractIngredient
- All Implemented Interfaces:
io.github.tropheusj.serialization_hooks.ingredient.CustomIngredient,Predicate<net.minecraft.world.item.ItemStack>
- Direct Known Subclasses:
DifferenceIngredient,IntersectionIngredient,NBTIngredient,PartialNBTIngredient
public abstract class AbstractIngredient
extends io.github.tropheusj.serialization_hooks.ingredient.BaseCustomIngredient
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
net.minecraft.world.item.crafting.Ingredient.ItemValue, net.minecraft.world.item.crafting.Ingredient.TagValue, net.minecraft.world.item.crafting.Ingredient.Value -
Field Summary
Fields inherited from class net.minecraft.world.item.crafting.Ingredient
EMPTY, values -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEmpty constructor, for the sake of dynamic ingredientsprotectedAbstractIngredient(Stream<? extends net.minecraft.world.item.crafting.Ingredient.Value> values) Value constructor, for ingredients that have some vanilla representation -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.world.item.crafting.IngredientfromJson(@Nullable com.google.gson.JsonElement json) Deprecated.static net.minecraft.world.item.crafting.IngredientfromNetwork(net.minecraft.network.FriendlyByteBuf buffer) Deprecated.useIngredient.fromNetwork(FriendlyByteBuf)static net.minecraft.world.item.crafting.IngredientfromValues(Stream<? extends net.minecraft.world.item.crafting.Ingredient.Value> values) Deprecated.useIngredient.fromValues(Stream)static net.minecraft.world.item.crafting.Ingredientof()Deprecated.useIngredient.of()static net.minecraft.world.item.crafting.IngredientDeprecated.useIngredient.of(Stream)(Stream)}static net.minecraft.world.item.crafting.Ingredientof(net.minecraft.tags.TagKey<net.minecraft.world.item.Item> tag) Deprecated.useIngredient.of(TagKey)(Stream)}static net.minecraft.world.item.crafting.Ingredientof(net.minecraft.world.item.ItemStack... stacks) Deprecated.useIngredient.of(ItemStack...)(Stream)}static net.minecraft.world.item.crafting.Ingredientof(net.minecraft.world.level.ItemLike... items) Deprecated.useIngredient.of(ItemLike...)(Stream)}abstract com.google.gson.JsonElementtoJson()Methods inherited from class net.minecraft.world.item.crafting.Ingredient
getItems, getStackingIds, isEmpty, test, toNetwork, valueFromJsonMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.tropheusj.serialization_hooks.ingredient.CustomIngredient
customDeserializer, customTest, getDeserializer, testCustom
-
Constructor Details
-
AbstractIngredient
protected AbstractIngredient()Empty constructor, for the sake of dynamic ingredients -
AbstractIngredient
protected AbstractIngredient(Stream<? extends net.minecraft.world.item.crafting.Ingredient.Value> values) Value constructor, for ingredients that have some vanilla representation
-
-
Method Details
-
toJson
public abstract com.google.gson.JsonElement toJson()- Overrides:
toJsonin classnet.minecraft.world.item.crafting.Ingredient
-
fromValues
@Deprecated public static net.minecraft.world.item.crafting.Ingredient fromValues(Stream<? extends net.minecraft.world.item.crafting.Ingredient.Value> values) Deprecated.useIngredient.fromValues(Stream) -
of
Deprecated.useIngredient.of() -
of
@Deprecated public static net.minecraft.world.item.crafting.Ingredient of(net.minecraft.world.level.ItemLike... items) Deprecated.useIngredient.of(ItemLike...)(Stream)} -
of
@Deprecated public static net.minecraft.world.item.crafting.Ingredient of(net.minecraft.world.item.ItemStack... stacks) Deprecated.useIngredient.of(ItemStack...)(Stream)} -
of
@Deprecated public static net.minecraft.world.item.crafting.Ingredient of(Stream<net.minecraft.world.item.ItemStack> stacks) Deprecated.useIngredient.of(Stream)(Stream)} -
of
@Deprecated public static net.minecraft.world.item.crafting.Ingredient of(net.minecraft.tags.TagKey<net.minecraft.world.item.Item> tag) Deprecated.useIngredient.of(TagKey)(Stream)} -
fromNetwork
@Deprecated public static net.minecraft.world.item.crafting.Ingredient fromNetwork(net.minecraft.network.FriendlyByteBuf buffer) Deprecated.useIngredient.fromNetwork(FriendlyByteBuf) -
fromJson
@Deprecated public static net.minecraft.world.item.crafting.Ingredient fromJson(@Nullable @Nullable com.google.gson.JsonElement json) Deprecated.useIngredient.fromJson(JsonElement)(Stream)}
-
Ingredient.fromJson(JsonElement)(Stream)}