Record Class AdvancementsPacket.DisplayData

java.lang.Object
java.lang.Record
net.minestom.server.network.packet.server.play.AdvancementsPacket.DisplayData
All Implemented Interfaces:
ComponentHolder<AdvancementsPacket.DisplayData>, NetworkBuffer.Writer
Enclosing class:
AdvancementsPacket

public static record AdvancementsPacket.DisplayData(@NotNull net.kyori.adventure.text.Component title, @NotNull net.kyori.adventure.text.Component description, @NotNull ItemStack icon, @NotNull FrameType frameType, int flags, @Nullable String backgroundTexture, float x, float y) extends Record implements NetworkBuffer.Writer, ComponentHolder<AdvancementsPacket.DisplayData>
  • Constructor Summary

    Constructors
    Constructor
    Description
    DisplayData(@NotNull net.kyori.adventure.text.Component title, @NotNull net.kyori.adventure.text.Component description, @NotNull ItemStack icon, @NotNull FrameType frameType, int flags, @Nullable String backgroundTexture, float x, float y)
    Creates an instance of a DisplayData record class.
    DisplayData(@NotNull NetworkBuffer reader)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable String
    Returns the value of the backgroundTexture record component.
    @NotNull Collection<net.kyori.adventure.text.Component>
    Gets the components held by this object.
    copyWithOperator(@NotNull UnaryOperator<net.kyori.adventure.text.Component> operator)
    Returns a copy of this object.
    @NotNull net.kyori.adventure.text.Component
    Returns the value of the description record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns the value of the flags record component.
    @NotNull FrameType
    Returns the value of the frameType record component.
    final int
    Returns a hash code value for this object.
    @NotNull ItemStack
    Returns the value of the icon record component.
    @NotNull net.kyori.adventure.text.Component
    Returns the value of the title record component.
    final String
    Returns a string representation of this record class.
    void
    write(@NotNull NetworkBuffer writer)
     
    float
    x()
    Returns the value of the x record component.
    float
    y()
    Returns the value of the y record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.minestom.server.adventure.ComponentHolder

    visitComponents
  • Constructor Details

    • DisplayData

      public DisplayData(@NotNull @NotNull NetworkBuffer reader)
    • DisplayData

      public DisplayData(@NotNull @NotNull net.kyori.adventure.text.Component title, @NotNull @NotNull net.kyori.adventure.text.Component description, @NotNull @NotNull ItemStack icon, @NotNull @NotNull FrameType frameType, int flags, @Nullable @Nullable String backgroundTexture, float x, float y)
      Creates an instance of a DisplayData record class.
      Parameters:
      title - the value for the title record component
      description - the value for the description record component
      icon - the value for the icon record component
      frameType - the value for the frameType record component
      flags - the value for the flags record component
      backgroundTexture - the value for the backgroundTexture record component
      x - the value for the x record component
      y - the value for the y record component
  • Method Details

    • write

      public void write(@NotNull @NotNull NetworkBuffer writer)
      Specified by:
      write in interface NetworkBuffer.Writer
    • components

      @NotNull public @NotNull Collection<net.kyori.adventure.text.Component> components()
      Description copied from interface: ComponentHolder
      Gets the components held by this object.
      Specified by:
      components in interface ComponentHolder<AdvancementsPacket.DisplayData>
      Returns:
      the components
    • copyWithOperator

      @NotNull public @NotNull AdvancementsPacket.DisplayData copyWithOperator(@NotNull @NotNull UnaryOperator<net.kyori.adventure.text.Component> operator)
      Description copied from interface: ComponentHolder
      Returns a copy of this object. For each component this object holds, the operator is applied to the copy before returning.
      Specified by:
      copyWithOperator in interface ComponentHolder<AdvancementsPacket.DisplayData>
      Parameters:
      operator - the operator
      Returns:
      the copy
    • 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 '=='.
      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.
    • title

      @NotNull public @NotNull net.kyori.adventure.text.Component title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • description

      @NotNull public @NotNull net.kyori.adventure.text.Component description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • icon

      @NotNull public @NotNull ItemStack icon()
      Returns the value of the icon record component.
      Returns:
      the value of the icon record component
    • frameType

      @NotNull public @NotNull FrameType frameType()
      Returns the value of the frameType record component.
      Returns:
      the value of the frameType record component
    • flags

      public int flags()
      Returns the value of the flags record component.
      Returns:
      the value of the flags record component
    • backgroundTexture

      @Nullable public @Nullable String backgroundTexture()
      Returns the value of the backgroundTexture record component.
      Returns:
      the value of the backgroundTexture record component
    • x

      public float x()
      Returns the value of the x record component.
      Returns:
      the value of the x record component
    • y

      public float y()
      Returns the value of the y record component.
      Returns:
      the value of the y record component