Record Class BattleAnimationClientAcknowledgement
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.battles.animation.schedule.BattleAnimationClientAcknowledgement
public record BattleAnimationClientAcknowledgement(int timeoutTicks, BattleAnimationAcknowledgeTimeoutPolicy timeoutPolicy, Optional<ScheduledBattleAnimationAction> timeoutFallback)
extends Record
Configuration for waiting on client acknowledgement before a timeline proceeds.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<BattleAnimationClientAcknowledgement> static final BattleAnimationClientAcknowledgement -
Constructor Summary
ConstructorsConstructorDescriptionBattleAnimationClientAcknowledgement(int timeoutTicks, BattleAnimationAcknowledgeTimeoutPolicy timeoutPolicy, Optional<ScheduledBattleAnimationAction> timeoutFallback) Creates an instance of aBattleAnimationClientAcknowledgementrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncreateState(Set<UUID> waitingFor) Creates the runtime acknowledgement state for a set of clients.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisNone()Returns whether this configuration disables acknowledgement waiting.Returns the value of thetimeoutFallbackrecord component.Returns the value of thetimeoutPolicyrecord component.intReturns the value of thetimeoutTicksrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
NONE
-
CODEC
-
-
Constructor Details
-
BattleAnimationClientAcknowledgement
public BattleAnimationClientAcknowledgement(int timeoutTicks, BattleAnimationAcknowledgeTimeoutPolicy timeoutPolicy, Optional<ScheduledBattleAnimationAction> timeoutFallback) Creates an instance of aBattleAnimationClientAcknowledgementrecord class.- Parameters:
timeoutTicks- the value for thetimeoutTicksrecord componenttimeoutPolicy- the value for thetimeoutPolicyrecord componenttimeoutFallback- the value for thetimeoutFallbackrecord component
-
-
Method Details
-
isNone
public boolean isNone()Returns whether this configuration disables acknowledgement waiting.- Returns:
truewhen no acknowledgement should be requested
-
createState
Creates the runtime acknowledgement state for a set of clients.- Parameters:
waitingFor- the player ids that must acknowledge- Returns:
- the acknowledgement state
-
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 '=='. -
timeoutTicks
public int timeoutTicks()Returns the value of thetimeoutTicksrecord component.- Returns:
- the value of the
timeoutTicksrecord component
-
timeoutPolicy
Returns the value of thetimeoutPolicyrecord component.- Returns:
- the value of the
timeoutPolicyrecord component
-
timeoutFallback
Returns the value of thetimeoutFallbackrecord component.- Returns:
- the value of the
timeoutFallbackrecord component
-