Class DifferenceIngredient

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.DifferenceIngredient
All Implemented Interfaces:
io.github.tropheusj.serialization_hooks.ingredient.CustomIngredient, Predicate<net.minecraft.world.item.ItemStack>

public class DifferenceIngredient extends AbstractIngredient
Ingredient that matches everything from the first ingredient that is not included in the second ingredient
  • 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
    DifferenceIngredient(net.minecraft.world.item.crafting.Ingredient base, net.minecraft.world.item.crafting.Ingredient subtracted)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    io.github.tropheusj.serialization_hooks.ingredient.IngredientDeserializer
     
    net.minecraft.world.item.ItemStack[]
     
    it.unimi.dsi.fastutil.ints.IntList
     
    boolean
     
    of(net.minecraft.world.item.crafting.Ingredient base, net.minecraft.world.item.crafting.Ingredient subtracted)
    Gets the difference from the two ingredients
    boolean
    test(@Nullable net.minecraft.world.item.ItemStack stack)
     
    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

    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

    • DifferenceIngredient

      protected DifferenceIngredient(net.minecraft.world.item.crafting.Ingredient base, net.minecraft.world.item.crafting.Ingredient subtracted)
  • Method Details

    • of

      public static DifferenceIngredient of(net.minecraft.world.item.crafting.Ingredient base, net.minecraft.world.item.crafting.Ingredient subtracted)
      Gets the difference from the two ingredients
      Parameters:
      base - Ingredient the item must match
      subtracted - Ingredient the item must not match
      Returns:
      Ingredient that base anything in base that is not in subtracted
    • test

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

      public net.minecraft.world.item.ItemStack[] getItems()
      Overrides:
      getItems in class net.minecraft.world.item.crafting.Ingredient
    • isEmpty

      public boolean isEmpty()
      Overrides:
      isEmpty in class net.minecraft.world.item.crafting.Ingredient
    • getStackingIds

      public it.unimi.dsi.fastutil.ints.IntList getStackingIds()
      Overrides:
      getStackingIds in class net.minecraft.world.item.crafting.Ingredient
    • toJson

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

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

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