Class AdvancementDisplayWrapper

java.lang.Object
com.fren_gor.ultimateAdvancementAPI.nms.wrappers.AbstractWrapper
com.fren_gor.ultimateAdvancementAPI.nms.wrappers.advancement.AdvancementDisplayWrapper

public abstract class AdvancementDisplayWrapper extends AbstractWrapper
Wrapper class for NMS AdvancementDisplay.
  • Constructor Details

    • AdvancementDisplayWrapper

      public AdvancementDisplayWrapper()
  • Method Details

    • craft

      Creates a new AdvancementDisplayWrapper.

      The returned AdvancementDisplayWrapper is not hidden, doesn't show toast, doesn't announce to chat, and doesn't have a background texture.

      Parameters:
      icon - The icon of the advancement.
      title - The title of the advancement.
      description - The description of the advancement.
      frameType - The frame type of the advancement.
      x - The x coordinate in the advancement GUI.
      y - The y coordinate in the advancement GUI.
      Returns:
      A new AdvancementDisplayWrapper.
      Throws:
      ReflectiveOperationException - If reflections goes wrong.
    • craft

      Creates a new AdvancementDisplayWrapper.

      The returned AdvancementDisplayWrapper is not hidden, doesn't show toast, and doesn't announce to chat.

      Parameters:
      icon - The icon of the advancement.
      title - The title of the advancement.
      description - The description of the advancement.
      frameType - The frame type of the advancement.
      x - The x coordinate in the advancement GUI.
      y - The y coordinate in the advancement GUI.
      backgroundTexture - The path of the background texture of the advancement GUI. May be null if the advancement doesn't have a background texture.
      Returns:
      A new AdvancementDisplayWrapper.
      Throws:
      ReflectiveOperationException - If reflections goes wrong.
    • craft

      @NotNull public static @NotNull AdvancementDisplayWrapper craft(@NotNull @NotNull ItemStack icon, @NotNull @NotNull String title, @NotNull @NotNull String description, @NotNull @NotNull AdvancementFrameTypeWrapper frameType, float x, float y, boolean showToast, boolean announceChat, boolean hidden) throws ReflectiveOperationException
      Creates a new AdvancementDisplayWrapper.

      The returned AdvancementDisplayWrapper doesn't have a background texture.

      Parameters:
      icon - The icon of the advancement.
      title - The title of the advancement.
      description - The description of the advancement.
      frameType - The frame type of the advancement.
      x - The x coordinate in the advancement GUI.
      y - The y coordinate in the advancement GUI.
      showToast - Whether to show toast on grant.
      announceChat - Whether to announce grants to chat.
      hidden - Whether the advancement should be not visible in the advancement GUI. Connections to other advancements are always displayed.
      Returns:
      A new AdvancementDisplayWrapper.
      Throws:
      ReflectiveOperationException - If reflections goes wrong.
    • craft

      @NotNull public static @NotNull AdvancementDisplayWrapper craft(@NotNull @NotNull ItemStack icon, @NotNull @NotNull String title, @NotNull @NotNull String description, @NotNull @NotNull AdvancementFrameTypeWrapper frameType, float x, float y, boolean showToast, boolean announceChat, boolean hidden, @Nullable @Nullable String backgroundTexture) throws ReflectiveOperationException
      Creates a new AdvancementDisplayWrapper.
      Parameters:
      icon - The icon of the advancement.
      title - The title of the advancement.
      description - The description of the advancement.
      frameType - The frame type of the advancement.
      x - The x coordinate in the advancement GUI.
      y - The y coordinate in the advancement GUI.
      showToast - Whether to show toast on grant.
      announceChat - Whether to announce grants to chat.
      hidden - Whether the advancement should be not visible in the advancement GUI. Connections to other advancements are always displayed.
      backgroundTexture - The path of the background texture of the advancement GUI. May be null if the advancement doesn't have a background texture.
      Returns:
      A new AdvancementDisplayWrapper.
      Throws:
      ReflectiveOperationException - If reflections goes wrong.
    • getIcon

      @NotNull public abstract @NotNull ItemStack getIcon()
      Gets the icon of the advancement.
      Returns:
      The icon of the advancement.
    • getTitle

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

      @NotNull public abstract @NotNull String getDescription()
      Gets the description of the advancement.
      Returns:
      The description of the advancement.
    • getAdvancementFrameType

      @NotNull public abstract @NotNull AdvancementFrameTypeWrapper getAdvancementFrameType()
      Gets the frame type of the advancement.
      Returns:
      The frame type of the advancement.
    • getX

      public abstract float getX()
      Gets the x coordinate of the advancement in the advancement GUI.
      Returns:
      The x coordinate of the advancement in the advancement GUI.
    • getY

      public abstract float getY()
      Gets the y coordinate of the advancement in the advancement GUI.
      Returns:
      The y coordinate of the advancement in the advancement GUI.
    • doesShowToast

      public abstract boolean doesShowToast()
      Returns whether toast is shown on grant.
      Returns:
      Whether toast is shown on grant.
    • doesAnnounceToChat

      public abstract boolean doesAnnounceToChat()
      Returns whether grants are announced to chat.
      Returns:
      Whether grants are announced to chat.
    • isHidden

      public abstract boolean isHidden()
      Returns whether the advancement should be hidden in the advancement GUI.
      Returns:
      Whether the advancement should be hidden in the advancement GUI.
    • getBackgroundTexture

      @Nullable public abstract @Nullable String getBackgroundTexture()
      Gets the path of the background texture of the advancement GUI.
      Returns:
      The path of the background texture of the advancement GUI, or null if the advancement doesn't have a background texture.