Record Class NotIngredientModifier<STACK>

java.lang.Object
java.lang.Record
com.petrolpark.core.recipe.ingredient.modifier.NotIngredientModifier<STACK>
All Implemented Interfaces:
ITypelessIngredientModifier<STACK>

public record NotIngredientModifier<STACK>(IIngredientModifier<? super STACK> modifier) extends Record implements ITypelessIngredientModifier<STACK>
  • Constructor Details

    • NotIngredientModifier

      public NotIngredientModifier(IIngredientModifier<? super STACK> modifier)
      Creates an instance of a NotIngredientModifier record class.
      Parameters:
      modifier - the value for the modifier record component
  • Method Details

    • codec

      public static final <STACK> com.mojang.serialization.MapCodec<NotIngredientModifier<STACK>> codec(com.mojang.serialization.Codec<IIngredientModifier<? super STACK>> typeCodec)
    • streamCodec

      public static final <STACK> net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,NotIngredientModifier<STACK>> streamCodec(net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,IIngredientModifier<? super STACK>> typeStreamCodec)
    • test

      public boolean test(STACK stack)
      Specified by:
      test in interface ITypelessIngredientModifier<STACK>
    • modifyExamples

      public void modifyExamples(List<? extends STACK> exampleStacks)
      Specified by:
      modifyExamples in interface ITypelessIngredientModifier<STACK>
    • modifyCounterExamples

      public void modifyCounterExamples(List<? extends STACK> counterExampleStacks)
      Specified by:
      modifyCounterExamples in interface ITypelessIngredientModifier<STACK>
    • addToDescription

      public void addToDescription(List<net.minecraft.network.chat.Component> description)
      Specified by:
      addToDescription in interface ITypelessIngredientModifier<STACK>
    • addToCounterDescription

      public void addToCounterDescription(List<net.minecraft.network.chat.Component> description)
      Specified by:
      addToCounterDescription in interface ITypelessIngredientModifier<STACK>
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • modifier

      public IIngredientModifier<? super STACK> modifier()
      Returns the value of the modifier record component.
      Returns:
      the value of the modifier record component