Record Class AnimationBundler

java.lang.Object
java.lang.Record
kr.toxicity.model.api.nms.AnimationBundler
Record Components:
standard - the packet bundler for standard Minecraft clients
mod - the packet bundler for clients with the specific mod enabled

public record AnimationBundler(@NotNull PacketBundler standard, @NotNull ModAnimationBundler mod) extends Record
A record that bundles animation packets for both standard clients and modded clients.
Since:
2.2.1
  • Constructor Details

    • AnimationBundler

      public AnimationBundler(@NotNull @NotNull PacketBundler standard, @NotNull @NotNull ModAnimationBundler mod)
      Creates an instance of a AnimationBundler record class.
      Parameters:
      standard - the value for the standard record component
      mod - the value for the mod record component
  • Method Details

    • isNotEmpty

      public boolean isNotEmpty()
      Checks if there are any animation packets to be sent.
      Returns:
      true if the standard packet bundler is not empty
      Since:
      2.2.1
    • send

      public void send(@NotNull @NotNull PlayerChannelHandler handler)
      Sends the appropriate animation packets to the player based on their client type.
      Parameters:
      handler - the player's channel handler used to determine mod status and send packets
      Since:
      2.2.1
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • standard

      @NotNull public @NotNull PacketBundler standard()
      Returns the value of the standard record component.
      Returns:
      the value of the standard record component
    • mod

      @NotNull public @NotNull ModAnimationBundler mod()
      Returns the value of the mod record component.
      Returns:
      the value of the mod record component