Package kr.toxicity.model.api.animation
Record Class AnimationModifier
java.lang.Object
java.lang.Record
kr.toxicity.model.api.animation.AnimationModifier
- Record Components:
predicate- predicatestart- start lerpend- end lerptype- animation typespeed- speed modifieroverride- overrideplayer- player
public record AnimationModifier(@NotNull BooleanSupplier predicate, int start, int end, AnimationIterator.Type type, @NotNull FloatSupplier speed, @Nullable Boolean override, @Nullable org.bukkit.entity.Player player)
extends Record
A modifier of animation.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AnimationModifierDefault modifierstatic final AnimationModifierDefault with play once modifier -
Constructor Summary
ConstructorsConstructorDescriptionAnimationModifier(int start, int end, float speed) Creates modifierAnimationModifier(@NotNull BooleanSupplier predicate, int start, int end, float speed) Creates modifierAnimationModifier(@NotNull BooleanSupplier predicate, int start, int end, AnimationIterator.Type type, float speed) Creates modifierAnimationModifier(@NotNull BooleanSupplier predicate, int start, int end, AnimationIterator.Type type, @NotNull FloatSupplier speed) Creates modifierAnimationModifier(@NotNull BooleanSupplier predicate, int start, int end, AnimationIterator.Type type, @NotNull FloatSupplier speed, @Nullable Boolean override, @Nullable org.bukkit.entity.Player player) Creates an instance of aAnimationModifierrecord class.AnimationModifier(@NotNull BooleanSupplier predicate, int start, int end, @NotNull FloatSupplier supplier) Creates modifier -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull AnimationModifier.Builderbuilder()Creates builderintend()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.@Nullable Booleanoverride()Returns the value of theoverriderecord component.booleanoverride(boolean original) Gets override@Nullable org.bukkit.entity.Playerplayer()Returns the value of theplayerrecord component.@NotNull BooleanSupplierReturns the value of thepredicaterecord component.@NotNull FloatSupplierspeed()Returns the value of thespeedrecord component.floatGets speed valueintstart()Returns the value of thestartrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.type(AnimationIterator.Type defaultType) Gets modifier's type or default value
-
Field Details
-
DEFAULT
Default modifier -
DEFAULT_WITH_PLAY_ONCE
Default with play once modifier
-
-
Constructor Details
-
AnimationModifier
public AnimationModifier(int start, int end, float speed) Creates modifier- Parameters:
start- start timeend- end timespeed- speed
-
AnimationModifier
public AnimationModifier(@NotNull @NotNull BooleanSupplier predicate, int start, int end, float speed) Creates modifier- Parameters:
predicate- animation predicatestart- start timeend- end timespeed- speed
-
AnimationModifier
public AnimationModifier(@NotNull @NotNull BooleanSupplier predicate, int start, int end, @NotNull @NotNull FloatSupplier supplier) Creates modifier- Parameters:
predicate- animation predicatestart- start timeend- end timesupplier- speed supplier
-
AnimationModifier
public AnimationModifier(@NotNull @NotNull BooleanSupplier predicate, int start, int end, @Nullable AnimationIterator.Type type, float speed) Creates modifier- Parameters:
predicate- animation predicatestart- start timeend- end timetype- typespeed- speed
-
AnimationModifier
public AnimationModifier(@NotNull @NotNull BooleanSupplier predicate, int start, int end, @Nullable AnimationIterator.Type type, @NotNull @NotNull FloatSupplier speed) Creates modifier- Parameters:
predicate- animation predicatestart- start timeend- end timetype- typespeed- speed
-
AnimationModifier
public AnimationModifier(@NotNull @NotNull BooleanSupplier predicate, int start, int end, @Nullable AnimationIterator.Type type, @NotNull @NotNull FloatSupplier speed, @Nullable @Nullable Boolean override, @Nullable @Nullable org.bukkit.entity.Player player) Creates an instance of aAnimationModifierrecord class.- Parameters:
predicate- the value for thepredicaterecord componentstart- the value for thestartrecord componentend- the value for theendrecord componenttype- the value for thetyperecord componentspeed- the value for thespeedrecord componentoverride- the value for theoverriderecord componentplayer- the value for theplayerrecord component
-
-
Method Details
-
builder
Creates builder- Returns:
- builder
-
type
Gets modifier's type or default value- Parameters:
defaultType- default value- Returns:
- modifier's type or default value
-
speedValue
public float speedValue()Gets speed value- Returns:
- speed value
-
override
public boolean override(boolean original) Gets override- Parameters:
original- original value- Returns:
- override
-
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 '=='. -
predicate
Returns the value of thepredicaterecord component.- Returns:
- the value of the
predicaterecord component
-
start
public int start()Returns the value of thestartrecord component.- Returns:
- the value of the
startrecord component
-
end
public int end()Returns the value of theendrecord component.- Returns:
- the value of the
endrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
speed
Returns the value of thespeedrecord component.- Returns:
- the value of the
speedrecord component
-
override
Returns the value of theoverriderecord component.- Returns:
- the value of the
overriderecord component
-
player
@Nullable public @Nullable org.bukkit.entity.Player player()Returns the value of theplayerrecord component.- Returns:
- the value of the
playerrecord component
-