Class RootAdvancement

java.lang.Object
com.fren_gor.ultimateAdvancementAPI.advancement.Advancement
com.fren_gor.ultimateAdvancementAPI.advancement.RootAdvancement

public class RootAdvancement extends Advancement
The first advancement of an advancement tree.

It has no parents and stores the path to the background texture image of the tab. Also, it must be always visible.

  • Constructor Details

    • RootAdvancement

      public RootAdvancement(@NotNull @NotNull AdvancementTab advancementTab, @NotNull @NotNull String key, @NotNull @NotNull AdvancementDisplay display, @NotNull @NotNull String backgroundTexture)
      Creates a new RootAdvancement with a maximum progression of 1.
      Parameters:
      advancementTab - The advancement tab of the advancement.
      key - The unique key of the advancement. It must be unique among the other advancements of the tab.
      display - The display information of this advancement.
      backgroundTexture - The path of the background texture image (like "textures/block/stone.png").
    • RootAdvancement

      public RootAdvancement(@NotNull @NotNull AdvancementTab advancementTab, @NotNull @NotNull String key, @NotNull @NotNull AdvancementDisplay display, @NotNull @NotNull String backgroundTexture, @Range(from=1, to=Integer.MAX_VALUE) int maxProgression)
      Creates a new RootAdvancement.
      Parameters:
      advancementTab - The advancement tab of the advancement.
      key - The unique key of the advancement. It must be unique among the other advancements of the tab.
      display - The display information of this advancement.
      backgroundTexture - The path of the background texture image (like "textures/block/stone.png").
      maxProgression - The maximum advancement progression.
  • Method Details

    • getNMSWrapper

      @NotNull public @NotNull AdvancementWrapper getNMSWrapper()
      Returns the NMS wrapper of this advancement. Should craft the NMS wrapper once and returns it henceforth.
      Specified by:
      getNMSWrapper in class Advancement
      Returns:
      The NMS wrapper of this advancement.
    • isVisible

      @Contract("_ -> true") public final boolean isVisible(@NotNull @NotNull Player player)
      Returns whether the advancement is visible to the provided player.

      The root advancement must be always visible, so this method always returns true.

      Overrides:
      isVisible in class Advancement
      Parameters:
      player - The player.
      Returns:
      Always true.
    • isVisible

      @Contract("_ -> true") public final boolean isVisible(@NotNull @NotNull UUID uuid)
      Returns whether the advancement is visible to the provided player.

      The root advancement must be always visible, so this method always returns true.

      Overrides:
      isVisible in class Advancement
      Parameters:
      uuid - The UUID of the player.
      Returns:
      Always true.
    • isVisible

      @Contract("_ -> true") public final boolean isVisible(@NotNull @NotNull TeamProgression progression)
      Returns whether the advancement is visible to the provided team.

      The root advancement must be always visible, so this method always returns true.

      Overrides:
      isVisible in class Advancement
      Parameters:
      progression - The TeamProgression of the team.
      Returns:
      Always true.
    • getBackgroundTexture

      @NotNull public @NotNull String getBackgroundTexture()
      Gets the path to the background texture image of the tab.
      Returns:
      The path to the background texture image of the tab.