Record Class BedrockItemAnimation
java.lang.Object
java.lang.Record
com.viaversion.viafabricplus.bedrock.appearance.BedrockItemAnimation
public record BedrockItemAnimation(BedrockItemAnimation.Item mainHand, BedrockItemAnimation.Item offHand, BedrockItemAnimation.Item renderedMainHand, BedrockItemAnimation.Item renderedOffHand, int remainingTicks)
extends Record
The target player's item queries use remaining ticks and distinguish equipped and rendered hands.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic final recordstatic final recordThe native player keeps the active use stack separate from its equipped hands. -
Constructor Summary
ConstructorsConstructorDescriptionBedrockItemAnimation(BedrockItemAnimation.Item mainHand, BedrockItemAnimation.Item offHand, BedrockItemAnimation.Item renderedMainHand, BedrockItemAnimation.Item renderedOffHand, int remainingTicks) Creates an instance of aBedrockItemAnimationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.equipmentQueries(Map<String, BedrockItemAnimation.Item> equipment) final inthashCode()Returns a hash code value for this object.mainHand()Returns the value of themainHandrecord component.offHand()Returns the value of theoffHandrecord component.queries()intReturns the value of theremainingTicksrecord component.static intremainingTicks(int nativeMax, int javaMax, int javaRemaining, boolean using) Keep elapsed use ticks unchanged when Java and native item durations differ.Returns the value of therenderedMainHandrecord component.Returns the value of therenderedOffHandrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
BedrockItemAnimation
public BedrockItemAnimation(BedrockItemAnimation.Item mainHand, BedrockItemAnimation.Item offHand, BedrockItemAnimation.Item renderedMainHand, BedrockItemAnimation.Item renderedOffHand, int remainingTicks) Creates an instance of aBedrockItemAnimationrecord class.- Parameters:
mainHand- the value for themainHandrecord componentoffHand- the value for theoffHandrecord componentrenderedMainHand- the value for therenderedMainHandrecord componentrenderedOffHand- the value for therenderedOffHandrecord componentremainingTicks- the value for theremainingTicksrecord component
-
-
Method Details
-
remainingTicks
public static int remainingTicks(int nativeMax, int javaMax, int javaRemaining, boolean using) Keep elapsed use ticks unchanged when Java and native item durations differ. -
queries
-
equipmentQueries
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
mainHand
Returns the value of themainHandrecord component.- Returns:
- the value of the
mainHandrecord component
-
offHand
Returns the value of theoffHandrecord component.- Returns:
- the value of the
offHandrecord component
-
renderedMainHand
Returns the value of therenderedMainHandrecord component.- Returns:
- the value of the
renderedMainHandrecord component
-
renderedOffHand
Returns the value of therenderedOffHandrecord component.- Returns:
- the value of the
renderedOffHandrecord component
-
remainingTicks
public int remainingTicks()Returns the value of theremainingTicksrecord component.- Returns:
- the value of the
remainingTicksrecord component
-