Record Class ContaminatedIngredientModifier

java.lang.Object
java.lang.Record
com.petrolpark.core.recipe.ingredient.modifier.ContaminatedIngredientModifier
All Implemented Interfaces:
IIngredientModifier<net.neoforged.neoforge.common.MutableDataComponentHolder>, ITypelessIngredientModifier<net.neoforged.neoforge.common.MutableDataComponentHolder>

public record ContaminatedIngredientModifier(net.minecraft.core.Holder<Contaminant> contaminant) extends Record implements IIngredientModifier<net.neoforged.neoforge.common.MutableDataComponentHolder>
  • Field Details

  • Constructor Details

    • ContaminatedIngredientModifier

      public ContaminatedIngredientModifier(net.minecraft.core.Holder<Contaminant> contaminant)
      Creates an instance of a ContaminatedIngredientModifier record class.
      Parameters:
      contaminant - the value for the contaminant record component
  • Method Details

    • test

      public boolean test(net.neoforged.neoforge.common.MutableDataComponentHolder stack)
      Specified by:
      test in interface ITypelessIngredientModifier<net.neoforged.neoforge.common.MutableDataComponentHolder>
    • modifyExamples

      public void modifyExamples(List<? extends net.neoforged.neoforge.common.MutableDataComponentHolder> exampleStacks)
      Specified by:
      modifyExamples in interface ITypelessIngredientModifier<net.neoforged.neoforge.common.MutableDataComponentHolder>
    • modifyCounterExamples

      public void modifyCounterExamples(List<? extends net.neoforged.neoforge.common.MutableDataComponentHolder> counterExampleStacks)
      Specified by:
      modifyCounterExamples in interface ITypelessIngredientModifier<net.neoforged.neoforge.common.MutableDataComponentHolder>
    • addToDescription

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

      public void addToCounterDescription(List<net.minecraft.network.chat.Component> description)
      Specified by:
      addToCounterDescription in interface ITypelessIngredientModifier<net.neoforged.neoforge.common.MutableDataComponentHolder>
    • getType

      public IIngredientModifierType<net.neoforged.neoforge.common.MutableDataComponentHolder> getType()
      Specified by:
      getType in interface IIngredientModifier<net.neoforged.neoforge.common.MutableDataComponentHolder>
    • 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.
    • contaminant

      public net.minecraft.core.Holder<Contaminant> contaminant()
      Returns the value of the contaminant record component.
      Returns:
      the value of the contaminant record component