Record Class ScheduledBattleAnimationAction
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.battles.animation.schedule.ScheduledBattleAnimationAction
public record ScheduledBattleAnimationAction(String channel, BattleAnimationChannelScope channelScope, BattleAnimationTime start, BattleAnimationTime end, BattleAnimationChannelPolicy policy, boolean blocksBattle, BattleAnimationClientAcknowledgement clientAcknowledgement, BattleAnimationAction action)
extends Record
One action entry in a battle animation timeline schedule.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ScheduledBattleAnimationAction> -
Constructor Summary
ConstructorsConstructorDescriptionScheduledBattleAnimationAction(String channel, BattleAnimationChannelScope channelScope, BattleAnimationTime start, BattleAnimationTime end, BattleAnimationChannelPolicy policy, boolean blocksBattle, BattleAnimationClientAcknowledgement clientAcknowledgement, BattleAnimationAction action) Creates an instance of aScheduledBattleAnimationActionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaction()Returns the value of theactionrecord component.booleanReturns the value of theblocksBattlerecord component.channel()Returns the value of thechannelrecord component.Returns the value of thechannelScoperecord component.Returns the value of theclientAcknowledgementrecord component.effectiveChannel(BattleController controller) Resolves the effective channel for this action and battle controller.end()Returns the value of theendrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.policy()Returns the value of thepolicyrecord component.intresolveDuration(Map<String, Integer> markers) Resolves how long the action may run after it actually starts.intresolveEnd(Map<String, Integer> markers) Resolves this action's end tick.intresolveStart(Map<String, Integer> markers) Resolves this action's start tick.start()Returns the value of thestartrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
ScheduledBattleAnimationAction
public ScheduledBattleAnimationAction(String channel, BattleAnimationChannelScope channelScope, BattleAnimationTime start, BattleAnimationTime end, BattleAnimationChannelPolicy policy, boolean blocksBattle, BattleAnimationClientAcknowledgement clientAcknowledgement, BattleAnimationAction action) Creates an instance of aScheduledBattleAnimationActionrecord class.- Parameters:
channel- the value for thechannelrecord componentchannelScope- the value for thechannelScoperecord componentstart- the value for thestartrecord componentend- the value for theendrecord componentpolicy- the value for thepolicyrecord componentblocksBattle- the value for theblocksBattlerecord componentclientAcknowledgement- the value for theclientAcknowledgementrecord componentaction- the value for theactionrecord component
-
-
Method Details
-
effectiveChannel
Resolves the effective channel for this action and battle controller.- Parameters:
controller- the current battle controller- Returns:
- the scoped channel name
-
resolveStart
Resolves this action's start tick.- Parameters:
markers- the timeline marker map- Returns:
- the resolved start tick
-
resolveEnd
Resolves this action's end tick.- Parameters:
markers- the timeline marker map- Returns:
- the resolved end tick, or
-1when no end is defined
-
resolveDuration
Resolves how long the action may run after it actually starts.- Parameters:
markers- the timeline marker map- Returns:
- the resolved duration, or
-1when no explicit duration is defined
-
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 '=='. -
channel
Returns the value of thechannelrecord component.- Returns:
- the value of the
channelrecord component
-
channelScope
Returns the value of thechannelScoperecord component.- Returns:
- the value of the
channelScoperecord component
-
start
Returns the value of thestartrecord component.- Returns:
- the value of the
startrecord component
-
end
Returns the value of theendrecord component.- Returns:
- the value of the
endrecord component
-
policy
Returns the value of thepolicyrecord component.- Returns:
- the value of the
policyrecord component
-
blocksBattle
public boolean blocksBattle()Returns the value of theblocksBattlerecord component.- Returns:
- the value of the
blocksBattlerecord component
-
clientAcknowledgement
Returns the value of theclientAcknowledgementrecord component.- Returns:
- the value of the
clientAcknowledgementrecord component
-
action
Returns the value of theactionrecord component.- Returns:
- the value of the
actionrecord component
-