Class AdvancementManager
java.lang.Object
eu.endercentral.crazy_advancements.manager.AdvancementManager
Represents a Manager that manages Players and Advancements
- Author:
- Axel
-
Constructor Summary
ConstructorDescriptionAdvancementManager
(NameKey name, Player... players) Constructor for creating Advancement Managers -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAdvancement
(Advancement... addedAdvancements) Adds advancements to the Manager
Duplicates will be discardedvoid
Adds a player to the managercreateNewSave
(UUID uuid, Advancement... advancements) Gets the Progress as JSONcreateNewSave
(Player player, Advancement... advancements) Gets the Progress as JSONstatic AdvancementManager
getAccessibleManager
(NameKey name) Gets an accessible Advancement Manager by it's Namestatic Collection<AdvancementManager>
Gets a list of all accessible Advancement ManagersgetAdvancement
(NameKey name) Gets an Advancement with a specified NameGets a list of Advancements in the ManagergetAdvancements
(String namespace) Gets a list of Advancements with a certain namespaceint
getCriteriaProgress
(UUID uuid, Advancement advancement) Gets the Criteria Progressint
getCriteriaProgress
(Player player, Advancement advancement) Gets the Criteria ProgressgetName()
Returns the Name of this ManagerGet a list of players in the ManagergrantAdvancement
(UUID uuid, Advancement advancement) Grants an advancement, also works with offline playersgrantAdvancement
(Player player, Advancement advancement) Grants an advancementgrantCriteria
(UUID uuid, Advancement advancement, String... criteria) Grans criteria for an advancement, also works with offline playersgrantCriteria
(Player player, Advancement advancement, String... criteria) Grants criteria for an advancementvoid
loadProgress
(UUID uuid, Advancement... advancements) Loads the progress for Advancements in this Managervoid
loadProgress
(UUID uuid, SaveFile saveFile, Advancement... advancements) Loads the progress for Advancements in this Managervoid
loadProgress
(Player player, Advancement... advancements) Loads the progress for Advancements in this Managervoid
loadProgress
(Player player, SaveFile saveFile, Advancement... advancements) Loads the progress for Advancements in this Managervoid
Makes the AdvancementManager accessible to commands and other plugins using it's Name
There can only be one Manager per Namevoid
removeAdvancement
(Advancement... removedAdvancements) Removes an advancement from the Managervoid
removePlayer
(Player player) Removes a player from the managervoid
Resets Accessibility-StatusrevokeAdvancement
(UUID uuid, Advancement advancement) Revokes an advancement, also works with offline playersrevokeAdvancement
(Player player, Advancement advancement) Revokes an advancementrevokeCriteria
(UUID uuid, Advancement advancement, String... criteria) Revokes criteria for an advancement, also works with offline playersrevokeCriteria
(Player player, Advancement advancement, String... criteria) Revokes criteria for an advancementvoid
saveProgress
(UUID uuid, Advancement... advancements) Saves the progress in this Advancement Managers filevoid
saveProgress
(Player player, Advancement... advancements) Saves the progress in this Advancement Managers filesetCriteriaProgress
(UUID uuid, Advancement advancement, int criteriaProgress) Sets the criteria progress for an advancement, also works with offline players
Only works for Advancements withCriteriaType
NUMBER and will returnSetCriteriaResult
INVALID if it doesn't matchsetCriteriaProgress
(Player player, Advancement advancement, int criteriaProgress) Sets the criteria progress for an advancement
Only works for Advancements withCriteriaType
Number and will returnSetCriteriaResult
INVALID if it doesn't matchvoid
unloadProgress
(UUID uuid, Advancement... advancements) Unloads progress for Advancements in this Managervoid
unloadProgress
(Player player, Advancement... advancements) Unloads progress for Advancements in this Managervoid
unloadVisibilityStatus
(UUID uuid, Advancement... advancements) Unloads the Visibility Status for Advancements in this Managervoid
unloadVisibilityStatus
(Player player, Advancement... advancements) Unloads the Visibility Status for Advancements in this Managervoid
updateAdvancement
(Advancement... updatedAdvancements) Updates advancements in this managervoid
updateProgress
(Player player, Advancement... advancements) Updates Advancement Progress for a Playervoid
Updates all Advancements in a Tab
If you have Advancements in different tabsvoid
updateVisibility
(Player player) Updates Visibility for Advancements in this Manager
-
Constructor Details
-
AdvancementManager
Constructor for creating Advancement Managers- Parameters:
name
- The Name of the Managerplayers
- All players that should be in the new manager from the start, can be changed at any time
-
-
Method Details
-
getAccessibleManager
Gets an accessible Advancement Manager by it's Name- Parameters:
name
- The Name of the Manager- Returns:
- the Manager or null if no matching Manager is found
-
getAccessibleManagers
Gets a list of all accessible Advancement Managers- Returns:
- A list of all accessible Advancement Managers
-
getName
Returns the Name of this Manager- Returns:
- The Name
-
addPlayer
Adds a player to the manager- Parameters:
player
- Player to add
-
removePlayer
Removes a player from the manager- Parameters:
player
- Player to remove
-
getPlayers
Get a list of players in the Manager- Returns:
- All players that have been added to the manager
-
addAdvancement
Adds advancements to the Manager
Duplicates will be discarded- Parameters:
addedAdvancements
- An array of all advancements that should be added
-
updateAdvancement
Updates advancements in this manager- Parameters:
updatedAdvancements
- The advancements that should be updated
-
removeAdvancement
Removes an advancement from the Manager- Parameters:
removedAdvancements
- An array of advancements that should be removed
-
getAdvancements
Gets a list of Advancements in the Manager- Returns:
- The list of Advancements
-
getAdvancements
Gets a list of Advancements with a certain namespace- Parameters:
namespace
- Namespace to check- Returns:
- A list of all advancements in the manager with a specified namespace
-
getAdvancement
Gets an Advancement with a specified Name- Parameters:
name
- Name to check- Returns:
- An advancement matching the given name or null if it doesn't exist in the AdvancementManager
-
makeAccessible
public void makeAccessible()Makes the AdvancementManager accessible to commands and other plugins using it's Name
There can only be one Manager per Name -
resetAccessible
public void resetAccessible()Resets Accessibility-Status -
updateTab
Updates all Advancements in a Tab
If you have Advancements in different tabs- Parameters:
player
- The target Playertab
- The tab to update
-
updateProgress
Updates Advancement Progress for a Player- Parameters:
player
- The target Playeradvancements
- An array of Advancements that need their progress updated
-
updateVisibility
Updates Visibility for Advancements in this Manager- Parameters:
player
- The target Player
-
grantAdvancement
Grants an advancement- Parameters:
player
- Recieveradvancement
- Advancement to grant- Returns:
- The Result of this operation
-
grantAdvancement
Grants an advancement, also works with offline players- Parameters:
uuid
- Receiver UUIDadvancement
- Advancement to grant- Returns:
- The Result of this operation
-
revokeAdvancement
Revokes an advancement- Parameters:
player
- Receiveradvancement
- Advancement to revoke- Returns:
- The Result of this operation
-
revokeAdvancement
Revokes an advancement, also works with offline players- Parameters:
uuid
- Receiver UUIDadvancement
- Advancement to revoke- Returns:
- The Result of this operation
-
grantCriteria
public GrantCriteriaResult grantCriteria(Player player, Advancement advancement, String... criteria) Grants criteria for an advancement- Parameters:
player
- Receiveradvancement
- The Advancementcriteria
- Array of criteria to grant- Returns:
- The Result of this operation
-
grantCriteria
Grans criteria for an advancement, also works with offline players- Parameters:
uuid
- Receiveradvancement
- The Advancementcriteria
- Array of criteria to grant- Returns:
- The Result of this operation
-
revokeCriteria
Revokes criteria for an advancement- Parameters:
player
- Receiveradvancement
- The Advancementcriteria
- Array of criteria to revoke- Returns:
- The Result of this operation
-
revokeCriteria
Revokes criteria for an advancement, also works with offline players- Parameters:
uuid
- Receiveradvancement
- The Advancementcriteria
- Array of criteria to revoke- Returns:
- The Result of this operation
-
setCriteriaProgress
public SetCriteriaResult setCriteriaProgress(Player player, Advancement advancement, int criteriaProgress) Sets the criteria progress for an advancement
Only works for Advancements withCriteriaType
Number and will returnSetCriteriaResult
INVALID if it doesn't match- Parameters:
player
- Receiveradvancement
- The AdvancementcriteriaProgress
- Amount of progress- Returns:
- The Result of this operation
-
setCriteriaProgress
public SetCriteriaResult setCriteriaProgress(UUID uuid, Advancement advancement, int criteriaProgress) Sets the criteria progress for an advancement, also works with offline players
Only works for Advancements withCriteriaType
NUMBER and will returnSetCriteriaResult
INVALID if it doesn't match- Parameters:
uuid
- Receiveradvancement
- The AdvancementcriteriaProgress
- Array of criteria to revoke- Returns:
- The Result of this operation
-
getCriteriaProgress
Gets the Criteria Progress- Parameters:
player
- The target Playeradvancement
- The Advancement- Returns:
- The criteria progress
-
getCriteriaProgress
Gets the Criteria Progress- Parameters:
uuid
- The target Playeradvancement
- The Advancement- Returns:
- The criteria progress
-
createNewSave
Gets the Progress as JSON- Parameters:
player
- Player to checkadvancements
- A list of advancements that will have their progress saved- Leave empty if all Advancements should be saved- Returns:
- A JSON String representation of the progress for a player
-
createNewSave
Gets the Progress as JSON- Parameters:
uuid
- UUID of Player to checkadvancements
- A list of advancements that will have their progress saved- Leave empty if all Advancements should be saved- Returns:
- A JSON String representation of the progress for a player
-
saveProgress
Saves the progress in this Advancement Managers file- Parameters:
player
- Player to saveadvancements
- A list of advancements that will have their progress saved- Leave empty if all Advancements should be saved
-
saveProgress
Saves the progress in this Advancement Managers file- Parameters:
uuid
- UUID of Player to saveadvancements
- A list of advancements that will have their progress saved- Leave empty if all Advancements should be saved
-
loadProgress
Loads the progress for Advancements in this Manager- Parameters:
player
- Player to loadadvancements
- A list of advancements that will have their progress loaded - Leave empty if all Advancements should be loaded
-
loadProgress
Loads the progress for Advancements in this Manager- Parameters:
uuid
- UUID of Player to loadadvancements
- A list of advancements that will have their progress loaded - Leave empty if all Advancements should be loaded
-
loadProgress
Loads the progress for Advancements in this Manager- Parameters:
player
- Player to loadsaveFile
- The Save File to be loaded fromadvancements
- A list of advancements that will have their progress loaded - Leave empty if all Advancements should be loaded
-
loadProgress
Loads the progress for Advancements in this Manager- Parameters:
uuid
- UUID of Player to loadsaveFile
- The Save File to be loaded fromadvancements
- A list of advancements that will have their progress loaded - Leave empty if all Advancements should be loaded
-
unloadProgress
Unloads progress for Advancements in this Manager- Parameters:
player
- Player to unloadadvancements
- A list of advancements that will have their progress unloaded - Leave empty if all Advancements should be unloaded
-
unloadProgress
Unloads progress for Advancements in this Manager- Parameters:
uuid
- UUID of Player to unloadadvancements
- A list of advancements that will have their progress unloaded - Leave empty if all Advancements should be unloaded
-
unloadVisibilityStatus
Unloads the Visibility Status for Advancements in this Manager- Parameters:
player
- Player to unloadadvancements
- A list of advancements that will have their Visibility Status unloaded - Leave empty if all Advancements should be unloaded
-
unloadVisibilityStatus
Unloads the Visibility Status for Advancements in this Manager- Parameters:
uuid
- UUID of Player to unloadadvancements
- A list of advancements that will have their Visibility Status unloaded - Leave empty if all Advancements should be unloaded
-