Record Class TypeAttachedIngredientModifier<STACK,MODIFIER extends ITypelessIngredientModifier<? super STACK>>

java.lang.Object
java.lang.Record
com.petrolpark.core.recipe.ingredient.modifier.TypeAttachedIngredientModifier<STACK,MODIFIER>
All Implemented Interfaces:
IIngredientModifier<STACK>, ITypelessIngredientModifier<STACK>

public record TypeAttachedIngredientModifier<STACK,MODIFIER extends ITypelessIngredientModifier<? super STACK>>(MODIFIER extends ITypelessIngredientModifier<? super STACK> untypedModifier, IIngredientModifierType<STACK> type) extends Record implements IIngredientModifier<STACK>
  • Constructor Details

    • TypeAttachedIngredientModifier

      public TypeAttachedIngredientModifier(MODIFIER untypedModifier, IIngredientModifierType<STACK> type)
      Creates an instance of a TypeAttachedIngredientModifier record class.
      Parameters:
      untypedModifier - the value for the untypedModifier record component
      type - the value for the type record component
  • Method Details

    • 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>
    • getType

      public IIngredientModifierType<? super STACK> getType()
      Specified by:
      getType in interface IIngredientModifier<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.
    • untypedModifier

      public MODIFIER untypedModifier()
      Returns the value of the untypedModifier record component.
      Returns:
      the value of the untypedModifier record component
    • type

      Returns the value of the type record component.
      Returns:
      the value of the type record component