Class RootAdvancement
java.lang.Object
com.fren_gor.ultimateAdvancementAPI.advancement.Advancement
com.fren_gor.ultimateAdvancementAPI.advancement.RootAdvancement
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.
-
Field Summary
Fields inherited from class com.fren_gor.ultimateAdvancementAPI.advancement.Advancement
advancementTab, display, key, maxProgression
-
Constructor Summary
ConstructorDescriptionRootAdvancement
(@NotNull AdvancementTab advancementTab, @NotNull String key, @NotNull AdvancementDisplay display, @NotNull String backgroundTexture) Creates a newRootAdvancement
with a maximum progression of1
.RootAdvancement
(@NotNull AdvancementTab advancementTab, @NotNull String key, @NotNull AdvancementDisplay display, @NotNull String backgroundTexture, @Range(from=1, to=Integer.MAX_VALUE) int maxProgression) Creates a newRootAdvancement
. -
Method Summary
Modifier and TypeMethodDescriptionGets the path to the background texture image of the tab.Returns the NMS wrapper of this advancement.final boolean
isVisible
(@NotNull TeamProgression progression) Returns whether the advancement is visible to the provided team.final boolean
Returns whether the advancement is visible to the provided player.final boolean
Returns whether the advancement is visible to the provided player.Methods inherited from class com.fren_gor.ultimateAdvancementAPI.advancement.Advancement
displayToastToPlayer, equals, getAdvancementTab, getAnnounceMessage, getDisplay, getKey, getMaxProgression, getProgression, getProgression, getProgression, giveReward, grant, grant, handlePlayer, hashCode, incrementProgression, incrementProgression, incrementProgression, incrementProgression, incrementProgression, incrementProgression, incrementProgression, incrementProgression, incrementProgression, isGranted, isGranted, isGranted, isValid, onDispose, onGrant, onRegister, onUpdate, registerEvent, registerEvent, revoke, setProgression, setProgression, setProgression, setProgression, setProgression, toString, validateRegister
-
Constructor Details
-
RootAdvancement
public RootAdvancement(@NotNull @NotNull AdvancementTab advancementTab, @NotNull @NotNull String key, @NotNull @NotNull AdvancementDisplay display, @NotNull @NotNull String backgroundTexture) Creates a newRootAdvancement
with a maximum progression of1
.- 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 newRootAdvancement
.- 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
Returns the NMS wrapper of this advancement. Should craft the NMS wrapper once and returns it henceforth.- Specified by:
getNMSWrapper
in classAdvancement
- Returns:
- The NMS wrapper of this advancement.
-
isVisible
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 classAdvancement
- Parameters:
player
- The player.- Returns:
- Always
true
.
-
isVisible
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 classAdvancement
- Parameters:
uuid
- TheUUID
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 classAdvancement
- Parameters:
progression
- TheTeamProgression
of the team.- Returns:
- Always
true
.
-
getBackgroundTexture
Gets the path to the background texture image of the tab.- Returns:
- The path to the background texture image of the tab.
-