java.lang.Object
com.fren_gor.ultimateAdvancementAPI.advancement.display.AdvancementDisplay
Direct Known Subclasses:
FakeAdvancement.FakeAdvancementDisplay, FancyAdvancementDisplay

public class AdvancementDisplay extends Object
The AdvancementDisplay class contains the graphical information of the advancement.

It contains the title, description, icon, etc. etc.

  • Field Details

    • icon

      protected final ItemStack icon
      The icon of the advancement in the advancement GUI.
    • chatTitle

      protected final BaseComponent[] chatTitle
    • chatDescription

      protected final BaseComponent[] chatDescription
      The fancy description used by Advancement.getAnnounceMessage(Player).
    • title

      protected final String title
      The title of the advancement.
    • rawTitle

      protected final String rawTitle
      The trimmed title of the advancement.
    • description

      protected final @Unmodifiable List<String> description
      The description of the advancement.
    • compactDescription

      protected final String compactDescription
      The description of the advancement compacted as a single String (with '\n' + defaultColorCode between lines).
    • frame

      protected final AdvancementFrameType frame
      The shape of the advancement frame in the advancement GUI.
    • showToast

      protected final boolean showToast
      Whether the toast notification should be sent on advancement grant.
    • announceChat

      protected final boolean announceChat
      Whether the advancement completion message should be sent on advancement grant.
    • x

      protected final float x
      The advancement x coordinate.
    • y

      protected final float y
      The advancement y coordinate.
  • Constructor Details

    • AdvancementDisplay

      public AdvancementDisplay(@NotNull @NotNull Material icon, @NotNull @NotNull String title, @NotNull @NotNull AdvancementFrameType frame, boolean showToast, boolean announceChat, float x, float y, @NotNull @NotNull String... description)
      Creates a new AdvancementDisplay.

      The default color of the title and description is frame.getColor().

      The advancement is positioned by the x and y coordinates in the advancement GUI. The origin is placed in the upper-left corner of the advancement GUI. The x-axis points to the right (as usual), whereas the y-axis points downward. Thus, the x and y coordinates must be positive.

      Parameters:
      icon - The material of the advancement's icon in the advancement GUI.
      title - The title of the advancement.
      frame - The shape of the advancement frame in the advancement GUI.
      showToast - Whether the toast notification should be sent on advancement grant.
      announceChat - Whether the advancement completion message should be sent on advancement grant.
      x - The advancement x coordinate. Must be not negative.
      y - The advancement y coordinate. Must be not negative.
      description - The description of the advancement.
    • AdvancementDisplay

      public AdvancementDisplay(@NotNull @NotNull Material icon, @NotNull @NotNull String title, @NotNull @NotNull AdvancementFrameType frame, boolean showToast, boolean announceChat, float x, float y, @NotNull @NotNull List<String> description)
      Creates a new AdvancementDisplay.

      The default color of the title and description is frame.getColor().

      The advancement is positioned by the x and y coordinates in the advancement GUI. The origin is placed in the upper-left corner of the advancement GUI. The x-axis points to the right (as usual), whereas the y-axis points downward. Thus, the x and y coordinates must be positive.

      Parameters:
      icon - The material of the advancement's icon in the advancement GUI.
      title - The title of the advancement.
      frame - The shape of the advancement frame in the advancement GUI.
      showToast - Whether the toast notification should be sent on advancement grant.
      announceChat - Whether the advancement completion message should be sent on advancement grant.
      x - The advancement x coordinate. Must be not negative.
      y - The advancement y coordinate. Must be not negative.
      description - The description of the advancement.
    • AdvancementDisplay

      public AdvancementDisplay(@NotNull @NotNull ItemStack icon, @NotNull @NotNull String title, @NotNull @NotNull AdvancementFrameType frame, boolean showToast, boolean announceChat, float x, float y, @NotNull @NotNull String... description)
      Creates a new AdvancementDisplay.

      The default color of the title and description is frame.getColor().

      The advancement is positioned by the x and y coordinates in the advancement GUI. The origin is placed in the upper-left corner of the advancement GUI. The x-axis points to the right (as usual), whereas the y-axis points downward. Thus, the x and y coordinates must be positive.

      Parameters:
      icon - The advancement's icon in the advancement GUI.
      title - The title of the advancement.
      frame - The shape of the advancement frame in the advancement GUI.
      showToast - Whether the toast notification should be sent on advancement grant.
      announceChat - Whether the advancement completion message should be sent on advancement grant.
      x - The advancement x coordinate. Must be not negative.
      y - The advancement y coordinate. Must be not negative.
      description - The description of the advancement.
    • AdvancementDisplay

      public AdvancementDisplay(@NotNull @NotNull ItemStack icon, @NotNull @NotNull String title, @NotNull @NotNull AdvancementFrameType frame, boolean showToast, boolean announceChat, float x, float y, @NotNull @NotNull List<String> description)
      Creates a new AdvancementDisplay.

      The default color of the title and description is frame.getColor().

      The advancement is positioned by the x and y coordinates in the advancement GUI. The origin is placed in the upper-left corner of the advancement GUI. The x-axis points to the right (as usual), whereas the y-axis points downward. Thus, the x and y coordinates must be positive.

      Parameters:
      icon - The advancement's icon in the advancement GUI.
      title - The title of the advancement.
      frame - The shape of the advancement frame in the advancement GUI.
      showToast - Whether the toast notification should be sent on advancement grant.
      announceChat - Whether the advancement completion message should be sent on advancement grant.
      x - The advancement x coordinate. Must be not negative.
      y - The advancement y coordinate. Must be not negative.
      description - The description of the advancement.
    • AdvancementDisplay

      public AdvancementDisplay(@NotNull @NotNull ItemStack icon, @NotNull @NotNull String title, @NotNull @NotNull AdvancementFrameType frame, boolean showToast, boolean announceChat, float x, float y, @NotNull @NotNull ChatColor defaultColor, @NotNull @NotNull String... description)
      Creates a new AdvancementDisplay.

      The advancement is positioned by the x and y coordinates in the advancement GUI. The origin is placed in the upper-left corner of the advancement GUI. The x-axis points to the right (as usual), whereas the y-axis points downward. Thus, the x and y coordinates must be positive.

      Parameters:
      icon - The advancement's icon in the advancement GUI.
      title - The title of the advancement.
      frame - The shape of the advancement frame in the advancement GUI.
      showToast - Whether the toast notification should be sent on advancement grant.
      announceChat - Whether the advancement completion message should be sent on advancement grant.
      x - The advancement x coordinate. Must be not negative.
      y - The advancement y coordinate. Must be not negative.
      defaultColor - The default color of the title and description.
      description - The description of the advancement.
    • AdvancementDisplay

      public AdvancementDisplay(@NotNull @NotNull ItemStack icon, @NotNull @NotNull String title, @NotNull @NotNull AdvancementFrameType frame, boolean showToast, boolean announceChat, float x, float y, @NotNull @NotNull ChatColor defaultColor, @NotNull @NotNull List<String> description)
      Creates a new AdvancementDisplay.

      The advancement is positioned by the x and y coordinates in the advancement GUI. The origin is placed in the upper-left corner of the advancement GUI. The x-axis points to the right (as usual), whereas the y-axis points downward. Thus, the x and y coordinates must be positive.

      Parameters:
      icon - The advancement's icon in the advancement GUI.
      title - The title of the advancement.
      frame - The shape of the advancement frame in the advancement GUI.
      showToast - Whether the toast notification should be sent on advancement grant.
      announceChat - Whether the advancement completion message should be sent on advancement grant.
      x - The advancement x coordinate. Must be not negative.
      y - The advancement y coordinate. Must be not negative.
      defaultColor - The default color of the title and description.
      description - The description of the advancement.
  • Method Details

    • doesShowToast

      public boolean doesShowToast()
      Returns whether the toast notification should be sent on advancement grant.
      Returns:
      Whether the toast notification should be sent on advancement grant.
    • doesAnnounceToChat

      public boolean doesAnnounceToChat()
      Returns whether the advancement completion message should be sent on advancement grant.
      Returns:
      Whether the advancement completion message should be sent on advancement grant.
    • getChatTitle

      @NotNull public @NotNull BaseComponent[] getChatTitle()
      Gets the BaseComponent array that contains the fancy title. Used by Advancement.getAnnounceMessage(Player).
      Returns:
      The BaseComponent array that contains the fancy title.
    • getChatDescription

      @NotNull public @NotNull BaseComponent[] getChatDescription()
      Gets the BaseComponent array that contains the fancy description. Used by Advancement.getAnnounceMessage(Player).
      Returns:
      The BaseComponent array that contains the fancy description.
    • getIcon

      @NotNull public @NotNull ItemStack getIcon()
      Gets a clone of the icon.
      Returns:
      A clone of the icon.
    • getNMSWrapper

      Returns the AdvancementDisplay NMS wrapper, using the provided advancement for construction (when necessary).
      Parameters:
      advancement - The advancement used, when necessary, to create the NMS wrapper. Must be not null.
      Returns:
      The AdvancementDisplay NMS wrapper.
    • getTitle

      @NotNull public @NotNull String getTitle()
      Returns the title of the advancement.
      Returns:
      The title of the advancement.
    • getRawTitle

      @NotNull public @NotNull String getRawTitle()
      Returns the trimmed title of the advancement.
      Returns:
      The trimmed title of the advancement.
    • getDescription

      public @Unmodifiable List<String> getDescription()
      Returns the description of the advancement.
      Returns:
      The description of the advancement.
    • getCompactDescription

      @NotNull public @NotNull String getCompactDescription()
      Returns the compacted description.
      Returns:
      The compacted description.
      See Also:
    • getFrame

      Returns the shape of the advancement frame in the advancement GUI.
      Returns:
      The shape of the advancement frame in the advancement GUI.
    • getX

      public float getX()
      Returns the advancement position relative to the x-axis.
      Returns:
      The x coordinate.
    • getY

      public float getY()
      Returns the advancement position relative to the y-axis.
      Returns:
      The y coordinate.