Class Advancement
java.lang.Object
eu.endercentral.crazy_advancements.advancement.Advancement
Represents an Advancement
- Author:
- Axel
-
Constructor Summary
ConstructorDescriptionAdvancement
(Advancement parent, NameKey name, AdvancementDisplay display, boolean childrenTracking, AdvancementFlag... flags) Constructor for Advancements with a parent and the option to disable children trackingAdvancement
(Advancement parent, NameKey name, AdvancementDisplay display, AdvancementFlag... flags) Constructor for Advancements with a parentAdvancement
(NameKey name, AdvancementDisplay display, boolean childrenTracking, AdvancementFlag... flags) Constructor for Root Advancements with the option to disable children trackingAdvancement
(NameKey name, AdvancementDisplay display, AdvancementFlag... flags) Constructor for Root Advancements -
Method Summary
Modifier and TypeMethodDescriptionvoid
displayMessageToEverybody
(Player player) Displays an Advancement Message to every Player saying Player has completed said advancement
Note that this doesn't grant the advancementvoid
displayToast
(Player player) Sends a Toast regardless if the Player has it in one of their Advancement Managers or notboolean
Gets all direct ChildrenGets the required Criteria that needs to be met in order to complete this AdvancementGet the Display of this AdvancementgetFlags()
Gets a list of the applied Flagsnet.md_5.bungee.api.chat.BaseComponent
getMessage
(Player player) Gets an Advancement MessagegetName()
Get the Unique Identifier of this AdvancementGets the Parent of this AdvancementgetProgress
(UUID uuid) Gets a Player's progressgetProgress
(Player player) Gets a player's progressGets the Reward of this AdvancementGets the Root AdvancementgetRow()
Gets all parents and childrenGets all childrenGets all parentsgetTab()
Gets the TabGets a Toast Notification for this Advancementboolean
getVisibilityStatus
(Player player) Gets the last saved Visibility Statusboolean
hasFlag
(AdvancementFlag flag) Checks whether this advancement has a certain flagboolean
Checks whether this Advancement has a specific Nameboolean
isAnythingGrantedAfter
(Player player) Checks whether any children have been grantedboolean
isAnythingGrantedUntil
(Player player) Checks whether any parents have been grantedboolean
Checks whether this Adavncement is granted to a certain playerboolean
Checks whether this Adavncement is granted to a certain playerboolean
isRoot()
Gets whether this Advancement is a Root Advancementvoid
saveVisibilityStatus
(Player player, boolean visible) Saves the current Visibility Status for a Player, later the visibility is checked against this value to decide whether it changedvoid
setCriteria
(Criteria criteria) Sets the required Criteria that needs to be met in order to complete this Advancementvoid
setReward
(AdvancementReward reward) Sets the Reward of this Advancementvoid
unloadProgress
(UUID uuid) Unloads the progress
Will not update the player, useAdvancementManager.unloadProgress(UUID uuid, Advancement...advancements)
for online Playersvoid
unloadProgress
(Player player) Unloads the progress
Will not update the player, useAdvancementManager.unloadProgress(Player player, Advancement...advancements)
for online Playersvoid
unloadVisibilityStatus
(UUID uuid) Unloads the Visibility Status for a Player
Should only be run after somebody disconnects to free up RAMvoid
unloadVisibilityStatus
(Player player) Unloads the Visibility Status for a Player
Should only be run after somebody disconnects to free up RAM
-
Constructor Details
-
Advancement
public Advancement(@Nullable Advancement parent, NameKey name, AdvancementDisplay display, AdvancementFlag... flags) Constructor for Advancements with a parent- Parameters:
parent
- Parent advancementname
- Unique Identifierdisplay
- The Display of the Advancementflags
- The flags which apply to this Advancement
-
Advancement
public Advancement(@Nullable Advancement parent, NameKey name, AdvancementDisplay display, boolean childrenTracking, AdvancementFlag... flags) Constructor for Advancements with a parent and the option to disable children tracking- Parameters:
parent
- Parent advancementname
- Unique Identifierdisplay
- The Display of the AdvancementchildrenTracking
- Whether children will be tracked. If false, direct children will not be cached resulting in methods like getRow() not containing advancements after this one. Advancements before this one will also be missing these advancements for the respective methods. Also certain behavior like AdvancementVisibility might not work as intendedflags
- The flags which apply to this Advancement
-
Advancement
Constructor for Root Advancements- Parameters:
name
- Unique Identifierdisplay
- The Display of the Advancementflags
- The flags which apply to this Advancement
-
Advancement
public Advancement(NameKey name, AdvancementDisplay display, boolean childrenTracking, AdvancementFlag... flags) Constructor for Root Advancements with the option to disable children tracking- Parameters:
name
- Unique Identifierdisplay
- The Display of the AdvancementchildrenTracking
- Whether children will be tracked. If false, direct children will not be cached resulting in methods like getRow() not containing advancements after this one. Advancements before this one will also be missing these advancements for the respective methods. Also certain behavior like AdvancementVisibility might not work as intendedflags
- The flags which apply to this Advancement
-
-
Method Details
-
getName
Get the Unique Identifier of this Advancement- Returns:
- The Unique Identifier for this Advancement
-
hasName
Checks whether this Advancement has a specific Name- Parameters:
key
- Key to check- Returns:
- true if
Advancement
name and key share the same namespace and name
-
getDisplay
Get the Display of this Advancement- Returns:
- the Display of this Advancement
-
setCriteria
Sets the required Criteria that needs to be met in order to complete this Advancement- Parameters:
criteria
- The required Criteria
-
getCriteria
Gets the required Criteria that needs to be met in order to complete this Advancement- Returns:
- The required Criteria
-
setReward
Sets the Reward of this Advancement- Parameters:
reward
- The Reward that should be given to Players upon completing this Advancement
-
getReward
Gets the Reward of this Advancement- Returns:
- The Reward that gets awarded to Players upon completing this Advancement
-
getParent
Gets the Parent of this Advancement- Returns:
- The Parent of this Advancement
-
isRoot
public boolean isRoot()Gets whether this Advancement is a Root Advancement- Returns:
- Whether this Advancement is a Root Advancement
-
getChildren
Gets all direct Children- Returns:
- All direct Children
-
getRootAdvancement
Gets the Root Advancement- Returns:
- The Root Advancement
-
getTab
Gets the Tab- Returns:
- NameKey of the Tabs Root Advancement
-
getRow
Gets all parents and children- Returns:
- All parents and children
-
getRowUntil
Gets all parents- Returns:
- All parents
-
getRowAfter
Gets all children- Returns:
- All children
-
isAnythingGrantedUntil
Checks whether any parents have been granted- Parameters:
player
- Player to check- Returns:
- true if any parent is granted
-
isAnythingGrantedAfter
Checks whether any children have been granted- Parameters:
player
- Player to check- Returns:
- true if any child is granted
-
getProgress
Gets a player's progress- Parameters:
player
- The player to check- Returns:
- The progress
-
getProgress
Gets a Player's progress- Parameters:
uuid
- The uuid of the player to check- Returns:
- The Player's progress
-
unloadProgress
Unloads the progress
Will not update the player, useAdvancementManager.unloadProgress(Player player, Advancement...advancements)
for online Players- Parameters:
player
- Player to unload progress
-
unloadProgress
Unloads the progress
Will not update the player, useAdvancementManager.unloadProgress(UUID uuid, Advancement...advancements)
for online Players- Parameters:
uuid
- UUID of Player to unload progress
-
isGranted
Checks whether this Adavncement is granted to a certain player- Parameters:
player
- Player to check- Returns:
- true if advancement is granted
-
isGranted
Checks whether this Adavncement is granted to a certain player- Parameters:
uuid
- The uuid of the Player to check- Returns:
- true if advancement is granted
-
getFlags
Gets a list of the applied Flags- Returns:
- The list containing the flags
-
hasFlag
Checks whether this advancement has a certain flag- Parameters:
flag
- The flag to check for- Returns:
- Whether this advancement has the specified flag
-
saveVisibilityStatus
Saves the current Visibility Status for a Player, later the visibility is checked against this value to decide whether it changed- Parameters:
player
- The Player to save the Visibility Status forvisible
- Whether the Visibility Status is true or false
-
getVisibilityStatus
Gets the last saved Visibility Status- Parameters:
player
- The Player to check- Returns:
- The Visibility Status
-
unloadVisibilityStatus
Unloads the Visibility Status for a Player
Should only be run after somebody disconnects to free up RAM- Parameters:
player
- The Player to Unload Visibility
-
unloadVisibilityStatus
Unloads the Visibility Status for a Player
Should only be run after somebody disconnects to free up RAM- Parameters:
player
- The UUID of Player to Unload Visibility
-
getToastNotification
Gets a Toast Notification for this Advancement- Returns:
- The Toast Notification
-
displayToast
Sends a Toast regardless if the Player has it in one of their Advancement Managers or not- Parameters:
player
- Player who should see the Toast Message
-
getMessage
Gets an Advancement Message- Parameters:
player
- Player who has recieved the advancement- Returns:
- The Advancement Message as a Base Component
-
displayMessageToEverybody
Displays an Advancement Message to every Player saying Player has completed said advancement
Note that this doesn't grant the advancement- Parameters:
player
- Player who has recieved the advancement
-
equals
-