Record Class MixerRecipes.MixerRecipe

java.lang.Object
java.lang.Record
com.hbm_m.recipe.MixerRecipes.MixerRecipe
Enclosing class:
MixerRecipes

public static record MixerRecipes.MixerRecipe(net.minecraft.world.level.material.Fluid inputA, int amountA, net.minecraft.world.level.material.Fluid inputB, int amountB, net.minecraft.world.level.material.Fluid output, int outputAmount, int duration, long energyPerTick) extends Record
Single mixer recipe: two input fluids (in any tank order) combine into one output fluid.
  • Constructor Summary

    Constructors
    Constructor
    Description
    MixerRecipe(net.minecraft.world.level.material.Fluid inputA, int amountA, net.minecraft.world.level.material.Fluid inputB, int amountB, net.minecraft.world.level.material.Fluid output, int outputAmount, int duration, long energyPerTick)
    Creates an instance of a MixerRecipe record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the amountA record component.
    int
    Returns the value of the amountB record component.
    int
    Returns the value of the duration record component.
    long
    Returns the value of the energyPerTick record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    net.minecraft.world.level.material.Fluid
    Returns the value of the inputA record component.
    net.minecraft.world.level.material.Fluid
    Returns the value of the inputB record component.
    boolean
    isDirectOrder(net.minecraft.world.level.material.Fluid tankA)
    Returns true if tankA corresponds to inputA (i.e. tanks are NOT swapped relative to this recipe's declaration order).
    boolean
    matches(net.minecraft.world.level.material.Fluid tankA, net.minecraft.world.level.material.Fluid tankB)
    Returns true if the given pair of fluids matches this recipe in either tank order.
    net.minecraft.world.level.material.Fluid
    Returns the value of the output record component.
    int
    Returns the value of the outputAmount record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MixerRecipe

      public MixerRecipe(net.minecraft.world.level.material.Fluid inputA, int amountA, net.minecraft.world.level.material.Fluid inputB, int amountB, net.minecraft.world.level.material.Fluid output, int outputAmount, int duration, long energyPerTick)
      Creates an instance of a MixerRecipe record class.
      Parameters:
      inputA - the value for the inputA record component
      amountA - the value for the amountA record component
      inputB - the value for the inputB record component
      amountB - the value for the amountB record component
      output - the value for the output record component
      outputAmount - the value for the outputAmount record component
      duration - the value for the duration record component
      energyPerTick - the value for the energyPerTick record component
  • Method Details

    • matches

      public boolean matches(net.minecraft.world.level.material.Fluid tankA, net.minecraft.world.level.material.Fluid tankB)
      Returns true if the given pair of fluids matches this recipe in either tank order.
    • isDirectOrder

      public boolean isDirectOrder(net.minecraft.world.level.material.Fluid tankA)
      Returns true if tankA corresponds to inputA (i.e. tanks are NOT swapped relative to this recipe's declaration order). Used to determine which tank to drain by which amount.
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • inputA

      public net.minecraft.world.level.material.Fluid inputA()
      Returns the value of the inputA record component.
      Returns:
      the value of the inputA record component
    • amountA

      public int amountA()
      Returns the value of the amountA record component.
      Returns:
      the value of the amountA record component
    • inputB

      public net.minecraft.world.level.material.Fluid inputB()
      Returns the value of the inputB record component.
      Returns:
      the value of the inputB record component
    • amountB

      public int amountB()
      Returns the value of the amountB record component.
      Returns:
      the value of the amountB record component
    • output

      public net.minecraft.world.level.material.Fluid output()
      Returns the value of the output record component.
      Returns:
      the value of the output record component
    • outputAmount

      public int outputAmount()
      Returns the value of the outputAmount record component.
      Returns:
      the value of the outputAmount record component
    • duration

      public int duration()
      Returns the value of the duration record component.
      Returns:
      the value of the duration record component
    • energyPerTick

      public long energyPerTick()
      Returns the value of the energyPerTick record component.
      Returns:
      the value of the energyPerTick record component