Class NBTIngredient

java.lang.Object
net.minecraft.world.item.crafting.Ingredient
io.github.tropheusj.serialization_hooks.ingredient.BaseCustomIngredient
io.github.vampirestudios.vampirelib.crafting.AbstractIngredient
io.github.vampirestudios.vampirelib.crafting.NBTIngredient
All Implemented Interfaces:
io.github.tropheusj.serialization_hooks.ingredient.CustomIngredient, Predicate<net.minecraft.world.item.ItemStack>

public class NBTIngredient extends AbstractIngredient
Ingredient that matches the given stack, performing an exact NBT match.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

    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
    NBTIngredient(net.minecraft.world.item.ItemStack stack)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    io.github.tropheusj.serialization_hooks.ingredient.IngredientDeserializer
     
    of(net.minecraft.world.item.ItemStack stack)
    Creates a new ingredient matching the given stack and tag
    boolean
    test(@Nullable net.minecraft.world.item.ItemStack input)
     
    com.google.gson.JsonElement
     
    void
    toNetwork(net.minecraft.network.FriendlyByteBuf buffer)
     

    Methods inherited from class io.github.vampirestudios.vampirelib.crafting.AbstractIngredient

    fromJson, fromNetwork, fromValues, of, of, of, of, of

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

    getItems, getStackingIds, isEmpty, 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, testCustom

    Methods inherited from interface java.util.function.Predicate

    and, negate, or
  • Constructor Details

    • NBTIngredient

      protected NBTIngredient(net.minecraft.world.item.ItemStack stack)
  • Method Details

    • of

      public static NBTIngredient of(net.minecraft.world.item.ItemStack stack)
      Creates a new ingredient matching the given stack and tag
    • test

      public boolean test(@Nullable @Nullable net.minecraft.world.item.ItemStack input)
      Specified by:
      test in interface Predicate<net.minecraft.world.item.ItemStack>
      Overrides:
      test in class net.minecraft.world.item.crafting.Ingredient
    • toJson

      public com.google.gson.JsonElement toJson()
      Specified by:
      toJson in class AbstractIngredient
    • toNetwork

      public void toNetwork(net.minecraft.network.FriendlyByteBuf buffer)
      Overrides:
      toNetwork in class net.minecraft.world.item.crafting.Ingredient
    • getDeserializer

      public io.github.tropheusj.serialization_hooks.ingredient.IngredientDeserializer getDeserializer()