Record Class SequencedGearshiftBlockEntity.SequenceContext

java.lang.Object
java.lang.Record
com.simibubi.create.content.kinetics.transmission.sequencer.SequencedGearshiftBlockEntity.SequenceContext
Enclosing class:
SequencedGearshiftBlockEntity

public static record SequencedGearshiftBlockEntity.SequenceContext(SequencerInstructions instruction, double relativeValue) extends Record
  • Constructor Details

    • SequenceContext

      public SequenceContext(SequencerInstructions instruction, double relativeValue)
      Creates an instance of a SequenceContext record class.
      Parameters:
      instruction - the value for the instruction record component
      relativeValue - the value for the relativeValue record component
  • Method Details

    • fromGearshift

      public static SequencedGearshiftBlockEntity.SequenceContext fromGearshift(SequencerInstructions instruction, double kineticSpeed, int absoluteValue)
    • getEffectiveValue

      public double getEffectiveValue(double speedAtTarget)
    • serializeNBT

      public net.minecraft.nbt.CompoundTag serializeNBT()
    • fromNBT

      public static SequencedGearshiftBlockEntity.SequenceContext fromNBT(net.minecraft.nbt.CompoundTag nbt)
    • 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.
    • instruction

      public SequencerInstructions instruction()
      Returns the value of the instruction record component.
      Returns:
      the value of the instruction record component
    • relativeValue

      public double relativeValue()
      Returns the value of the relativeValue record component.
      Returns:
      the value of the relativeValue record component