Record Class BattleTimeRemaining
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.battles.BattleTimeRemaining
- Record Components:
remainingTicks- The number of battle ticks remaining.totalTicks- The original timed battle duration in battle ticks.ticksPerSecond- The battle tick rate used for this timer.
public record BattleTimeRemaining(int remainingTicks, int totalTicks, int ticksPerSecond)
extends Record
Remaining timed battle state synced to clients.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<BattleTimeRemaining> -
Constructor Summary
ConstructorsConstructorDescriptionBattleTimeRemaining(int remainingTicks, int totalTicks, int ticksPerSecond) Creates an instance of aBattleTimeRemainingrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatprogress()intintReturns the value of theremainingTicksrecord component.intReturns the value of theticksPerSecondrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalTicksrecord component.
-
Field Details
-
CODEC
-
-
Constructor Details
-
BattleTimeRemaining
public BattleTimeRemaining(int remainingTicks, int totalTicks, int ticksPerSecond) Creates an instance of aBattleTimeRemainingrecord class.- Parameters:
remainingTicks- the value for theremainingTicksrecord componenttotalTicks- the value for thetotalTicksrecord componentticksPerSecond- the value for theticksPerSecondrecord component
-
-
Method Details
-
remainingSeconds
public int remainingSeconds() -
progress
public float progress() -
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. All components in this record class are compared with '=='. -
remainingTicks
public int remainingTicks()Returns the value of theremainingTicksrecord component.- Returns:
- the value of the
remainingTicksrecord component
-
totalTicks
public int totalTicks()Returns the value of thetotalTicksrecord component.- Returns:
- the value of the
totalTicksrecord component
-
ticksPerSecond
public int ticksPerSecond()Returns the value of theticksPerSecondrecord component.- Returns:
- the value of the
ticksPerSecondrecord component
-