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 Summary
ConstructorsConstructorDescriptionSequenceContext(SequencerInstructions instruction, double relativeValue) Creates an instance of aSequenceContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.fromGearshift(SequencerInstructions instruction, double kineticSpeed, int absoluteValue) fromNBT(net.minecraft.nbt.CompoundTag nbt) doublegetEffectiveValue(double speedAtTarget) final inthashCode()Returns a hash code value for this object.Returns the value of theinstructionrecord component.doubleReturns the value of therelativeValuerecord component.net.minecraft.nbt.CompoundTagfinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SequenceContext
Creates an instance of aSequenceContextrecord class.- Parameters:
instruction- the value for theinstructionrecord componentrelativeValue- the value for therelativeValuerecord 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
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
instruction
Returns the value of theinstructionrecord component.- Returns:
- the value of the
instructionrecord component
-
relativeValue
public double relativeValue()Returns the value of therelativeValuerecord component.- Returns:
- the value of the
relativeValuerecord component
-