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.
  • Constructor Details

    • BedrockItemAnimation

      public BedrockItemAnimation(BedrockItemAnimation.Item mainHand, BedrockItemAnimation.Item offHand, BedrockItemAnimation.Item renderedMainHand, BedrockItemAnimation.Item renderedOffHand, int remainingTicks)
      Creates an instance of a BedrockItemAnimation record class.
      Parameters:
      mainHand - the value for the mainHand record component
      offHand - the value for the offHand record component
      renderedMainHand - the value for the renderedMainHand record component
      renderedOffHand - the value for the renderedOffHand record component
      remainingTicks - the value for the remainingTicks record 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

      public Map<String,Object> queries()
    • equipmentQueries

      public static Map<String,Object> equipmentQueries(Map<String, BedrockItemAnimation.Item> equipment)
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • mainHand

      public BedrockItemAnimation.Item mainHand()
      Returns the value of the mainHand record component.
      Returns:
      the value of the mainHand record component
    • offHand

      public BedrockItemAnimation.Item offHand()
      Returns the value of the offHand record component.
      Returns:
      the value of the offHand record component
    • renderedMainHand

      public BedrockItemAnimation.Item renderedMainHand()
      Returns the value of the renderedMainHand record component.
      Returns:
      the value of the renderedMainHand record component
    • renderedOffHand

      public BedrockItemAnimation.Item renderedOffHand()
      Returns the value of the renderedOffHand record component.
      Returns:
      the value of the renderedOffHand record component
    • remainingTicks

      public int remainingTicks()
      Returns the value of the remainingTicks record component.
      Returns:
      the value of the remainingTicks record component