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 Component title, @NotNull 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 Details

    • DisplayData

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

      public DisplayData(@NotNull @NotNull Component title, @NotNull @NotNull 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<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<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 Component title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • description

      @NotNull public @NotNull 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