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

    Constructors
    Modifier
    Constructor
    Description
    protected
    Empty constructor, for the sake of dynamic ingredients
    protected
    AbstractIngredient(Stream<? extends net.minecraft.world.item.crafting.Ingredient.Value> values)
    Value constructor, for ingredients that have some vanilla representation
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.world.item.crafting.Ingredient
    fromJson(@Nullable com.google.gson.JsonElement json)
    Deprecated.
    use Ingredient.fromJson(JsonElement) (Stream)}
    static net.minecraft.world.item.crafting.Ingredient
    fromNetwork(net.minecraft.network.FriendlyByteBuf buffer)
    Deprecated.
    use Ingredient.fromNetwork(FriendlyByteBuf)
    static net.minecraft.world.item.crafting.Ingredient
    fromValues(Stream<? extends net.minecraft.world.item.crafting.Ingredient.Value> values)
    Deprecated.
    use Ingredient.fromValues(Stream)
    static net.minecraft.world.item.crafting.Ingredient
    of()
    Deprecated.
    use Ingredient.of()
    static net.minecraft.world.item.crafting.Ingredient
    of(Stream<net.minecraft.world.item.ItemStack> stacks)
    Deprecated.
    use Ingredient.of(Stream) (Stream)}
    static net.minecraft.world.item.crafting.Ingredient
    of(net.minecraft.tags.TagKey<net.minecraft.world.item.Item> tag)
    Deprecated.
    use Ingredient.of(TagKey) (Stream)}
    static net.minecraft.world.item.crafting.Ingredient
    of(net.minecraft.world.item.ItemStack... stacks)
    Deprecated.
    use Ingredient.of(ItemStack...) (Stream)}
    static net.minecraft.world.item.crafting.Ingredient
    of(net.minecraft.world.level.ItemLike... items)
    Deprecated.
    use Ingredient.of(ItemLike...) (Stream)}
    abstract com.google.gson.JsonElement
     

    Methods inherited from class net.minecraft.world.item.crafting.Ingredient

    getItems, getStackingIds, isEmpty, test, toNetwork, valueFromJson

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.github.tropheusj.serialization_hooks.ingredient.CustomIngredient

    customDeserializer, customTest, getDeserializer, testCustom

    Methods inherited from interface java.util.function.Predicate

    and, negate, or
  • 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:
      toJson in class net.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.
      use Ingredient.fromValues(Stream)
    • of

      @Deprecated public static net.minecraft.world.item.crafting.Ingredient of()
      Deprecated.
      use Ingredient.of()
    • of

      @Deprecated public static net.minecraft.world.item.crafting.Ingredient of(net.minecraft.world.level.ItemLike... items)
      Deprecated.
      use Ingredient.of(ItemLike...) (Stream)}
    • of

      @Deprecated public static net.minecraft.world.item.crafting.Ingredient of(net.minecraft.world.item.ItemStack... stacks)
      Deprecated.
      use Ingredient.of(ItemStack...) (Stream)}
    • of

      @Deprecated public static net.minecraft.world.item.crafting.Ingredient of(Stream<net.minecraft.world.item.ItemStack> stacks)
      Deprecated.
      use Ingredient.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.
      use Ingredient.of(TagKey) (Stream)}
    • fromNetwork

      @Deprecated public static net.minecraft.world.item.crafting.Ingredient fromNetwork(net.minecraft.network.FriendlyByteBuf buffer)
      Deprecated.
      use Ingredient.fromNetwork(FriendlyByteBuf)
    • fromJson

      @Deprecated public static net.minecraft.world.item.crafting.Ingredient fromJson(@Nullable @Nullable com.google.gson.JsonElement json)
      Deprecated.
      use Ingredient.fromJson(JsonElement) (Stream)}