Class UltimateAdvancementAPI
-
Method Summary
Modifier and TypeMethodDescriptioncreateAdvancementTab
(@NotNull String namespace) Creates a newAdvancementTab
with the provided namespace.void
Disables the vanilla advancements until next server restart or reload.void
displayCustomToast
(@NotNull Player player, @NotNull AdvancementDisplay display) Displays a custom toast notification to a player.void
displayCustomToast
(@NotNull Player player, @NotNull ItemStack icon, @NotNull String title, @NotNull AdvancementFrameType frame) Displays a custom toast notification to a player.filterNamespaces
(@Nullable String input) Returns the namespaced keys of every registered advancement which namespaced key starts with the provided one.getAdvancement
(@NotNull AdvancementKey namespacedKey) Returns the advancement with the provided namespaced key.getAdvancement
(@NotNull String namespacedKey) Returns the advancement with the provided namespaced key.getAdvancement
(@NotNull String namespace, @NotNull String key) Returns the advancement with the provided namespaced key.getAdvancementTab
(@NotNull String namespace) Gets an advancement tab by its namespace.Returns an unmodifiableSet
containing the namespaces of every registered advancement tab.static @NotNull UltimateAdvancementAPI
getInstance
(@NotNull Plugin plugin) Returns a new instance ofUltimateAdvancementAPI
.int
Returns the number of currently active loading requests for the specified player with the providedCacheFreeingOption.Option
.int
getLoadingRequestsAmount
(@NotNull OfflinePlayer offlinePlayer, CacheFreeingOption.Option type) Returns the number of currently active loading requests for the specified offline player with the providedCacheFreeingOption.Option
.int
getLoadingRequestsAmount
(@NotNull Player player, CacheFreeingOption.Option type) Returns the number of currently active loading requests for the specified player with the providedCacheFreeingOption.Option
.Returns an unmodifiableCollection
of the advancement tabs registered by the provided plugin.void
getStoredPlayerName
(@NotNull UUID uuid, @NotNull Consumer<ObjectResult<@Nullable String>> action) Gets the in-database stored name of the provided player.void
getStoredPlayerName
(@NotNull OfflinePlayer player, @NotNull Consumer<ObjectResult<@Nullable String>> action) Gets the in-database stored name of the provided player.getTabs()
Returns an unmodifiableCollection
of every registered advancement tab.getTeamProgression
(@NotNull UUID uuid) Returns theTeamProgression
of the team of the provided player.getTeamProgression
(@NotNull Player player) Returns theTeamProgression
of the team of the provided player.boolean
isAdvancementTabRegistered
(@NotNull String namespace) Returns whether an advancement tab with the provided namespace has already been registered.boolean
Returns whether the provided offline player is loaded into the caching system.boolean
isLoaded
(@NotNull OfflinePlayer player) Returns whether the provided offline player is loaded into the caching system.boolean
Returns whether the provided player is loaded into the caching system.boolean
isOfflinePlayerLoaded
(UUID uuid) Returns whether at least one loading request is currently active for the specified player.boolean
Returns whether at least one loading request is currently active for the specified offline player.void
isUnredeemed
(@NotNull Advancement advancement, @NotNull UUID uuid, @NotNull Consumer<ObjectResult<@NotNull Boolean>> action) Returns whether the provided advancement is unredeemed for the specified team.void
isUnredeemed
(@NotNull Advancement advancement, @NotNull Player player, @NotNull Consumer<ObjectResult<@NotNull Boolean>> action) Gets whether the provided advancement is unredeemed for the specified player.void
loadOfflinePlayer
(@NotNull UUID uuid) Loads the provided player from the database into the caching system.void
loadOfflinePlayer
(@NotNull UUID uuid, @NotNull CacheFreeingOption option, @Nullable Consumer<ObjectResult<@Nullable TeamProgression>> action) Loads the provided player from the database with the specifiedCacheFreeingOption
.void
loadOfflinePlayer
(@NotNull UUID uuid, @Nullable Consumer<ObjectResult<@Nullable TeamProgression>> action) Loads the provided player from the database without putting they into the caching system (seeCacheFreeingOption.DONT_CACHE()
).void
loadOfflinePlayer
(@NotNull OfflinePlayer player) Loads the provided offline player from the database into the caching system.void
loadOfflinePlayer
(@NotNull OfflinePlayer player, @NotNull CacheFreeingOption option, @Nullable Consumer<ObjectResult<@Nullable TeamProgression>> action) Loads the provided offline player from the database with the specifiedCacheFreeingOption
.void
loadOfflinePlayer
(@NotNull OfflinePlayer player, @Nullable Consumer<ObjectResult<@Nullable TeamProgression>> action) Loads the provided offline player from the database without putting they into the caching system (seeCacheFreeingOption.DONT_CACHE()
).void
movePlayerInNewTeam
(@NotNull UUID playerToMove) Moves the provided player into a new team.void
movePlayerInNewTeam
(@NotNull UUID playerToMove, @Nullable Consumer<ObjectResult<@NotNull TeamProgression>> action) Moves the provided player into a new team.void
movePlayerInNewTeam
(@NotNull Player playerToMove) Moves the provided player into a new team.void
movePlayerInNewTeam
(@NotNull Player playerToMove, @Nullable Consumer<ObjectResult<@NotNull TeamProgression>> action) Moves the provided player into a new team.void
setUnredeemed
(@NotNull Advancement advancement, @NotNull UUID uuid) Sets the provided advancement unredeemed for the specified player.void
setUnredeemed
(@NotNull Advancement advancement, @NotNull UUID uuid, boolean giveRewards) Sets the provided advancement unredeemed for the specified player.void
setUnredeemed
(@NotNull Advancement advancement, @NotNull UUID uuid, boolean giveRewards, @Nullable Consumer<Result> action) Sets the provided advancement unredeemed for the specified player.void
setUnredeemed
(@NotNull Advancement advancement, @NotNull UUID uuid, @Nullable Consumer<Result> action) Sets the provided advancement unredeemed for the specified player.void
setUnredeemed
(@NotNull Advancement advancement, @NotNull Player player) Sets the provided advancement unredeemed for the specified player.void
setUnredeemed
(@NotNull Advancement advancement, @NotNull Player player, boolean giveRewards) Sets the provided advancement unredeemed for the specified player.void
setUnredeemed
(@NotNull Advancement advancement, @NotNull Player player, boolean giveRewards, @Nullable Consumer<Result> action) Sets the provided advancement unredeemed for the specified player.void
setUnredeemed
(@NotNull Advancement advancement, @NotNull Player player, @Nullable Consumer<Result> action) Sets the provided advancement unredeemed for the specified player.void
unloadOfflinePlayer
(@NotNull UUID uuid) Removes one manual caching request for the provided player.void
unloadOfflinePlayer
(@NotNull OfflinePlayer player) Removes one manual caching request for the provided offline player.void
unregisterAdvancementTab
(@NotNull String namespace) Unregisters an advancement tab.void
Unregisters the provided player, removing they from the database.void
Unregisters the provided player, removing they from the database.void
Unregisters the provided offline player, removing they from the database.void
unregisterOfflinePlayer
(@NotNull OfflinePlayer player, @Nullable Consumer<Result> action) Unregisters the provided offline player, removing they from the database.void
Unregisters all the advancement tabs owned by the provided plugin.void
unsetUnredeemed
(@NotNull Advancement advancement, @NotNull UUID uuid) Redeems the specified advancement for the provided player.void
unsetUnredeemed
(@NotNull Advancement advancement, @NotNull UUID uuid, @Nullable Consumer<Result> action) Redeems the specified advancement for the provided player.void
unsetUnredeemed
(@NotNull Advancement advancement, @NotNull Player player) Redeems the specified advancement for the provided player.void
unsetUnredeemed
(@NotNull Advancement advancement, @NotNull Player player, @Nullable Consumer<Result> action) Redeems the specified advancement for the provided player.void
updatePlayer
(@NotNull Player player) Updates every advancement to a player.void
updatePlayerName
(@NotNull Player player) Updates the name of the specified player in the database.void
Updates the name of the specified player in the database.void
updatePlayerTeam
(@NotNull UUID playerToMove, @NotNull UUID aDestTeamPlayer) Moves the provided player from their team to the second player's one.void
updatePlayerTeam
(@NotNull UUID playerToMove, @NotNull UUID aDestTeamPlayer, @Nullable Consumer<Result> action) Moves the provided player from their team to the second player's one.void
updatePlayerTeam
(@NotNull Player playerToMove, @NotNull Player aDestTeamPlayer) Moves the provided player from their team to the second player's one.void
updatePlayerTeam
(@NotNull Player playerToMove, @NotNull Player aDestTeamPlayer, @Nullable Consumer<Result> action) Moves the provided player from their team to the second player's one.
-
Method Details
-
getInstance
@NotNull public static @NotNull UltimateAdvancementAPI getInstance(@NotNull @NotNull Plugin plugin) throws APINotInstantiatedException Returns a new instance ofUltimateAdvancementAPI
.- Parameters:
plugin
- The plugin that is going to use the instance.- Returns:
- A new instance of
UltimateAdvancementAPI
. - Throws:
APINotInstantiatedException
- If the API is not enabled.
-
createAdvancementTab
@NotNull @Contract("_ -> new") public @NotNull AdvancementTab createAdvancementTab(@NotNull @NotNull String namespace) throws DuplicatedException Creates a newAdvancementTab
with the provided namespace. The namespace must be unique.- Parameters:
namespace
- The unique namespace of the tab.- Returns:
- The new
AdvancementTab
. - Throws:
DuplicatedException
- If another tab with the name already exists.IllegalStateException
- If the API is not enabled.
-
getAdvancementTab
Gets an advancement tab by its namespace.- Parameters:
namespace
- The namespace of the advancement tab.- Returns:
- The advancement tab with the provided namespace, or
null
if there isn't any tab with such namespace. - Throws:
IllegalStateException
- If the API is not enabled.
-
isAdvancementTabRegistered
Returns whether an advancement tab with the provided namespace has already been registered.- Parameters:
namespace
- The namespace of the advancement tab.- Returns:
- Whether an advancement tab with the provided namespace has already been registered.
- Throws:
IllegalStateException
- If the API is not enabled.
-
getPluginAdvancementTabs
@NotNull public @UnmodifiableView @NotNull Collection<@NotNull AdvancementTab> getPluginAdvancementTabs()Returns an unmodifiableCollection
of the advancement tabs registered by the provided plugin.- Returns:
- An unmodifiable
Collection
of the advancement tabs registered by the provided plugin. - Throws:
IllegalStateException
- If the API is not enabled.
-
unregisterAdvancementTab
Unregisters an advancement tab.- Parameters:
namespace
- The namespace of the advancement tab to be unregistered.- Throws:
IllegalStateException
- If the API is not enabled.
-
unregisterPluginAdvancementTabs
public void unregisterPluginAdvancementTabs()Unregisters all the advancement tabs owned by the provided plugin.- Throws:
IllegalStateException
- If the API is not enabled.
-
getAdvancementTabNamespaces
@NotNull @Contract(pure=true) public @NotNull @UnmodifiableView Set<@NotNull String> getAdvancementTabNamespaces()Returns an unmodifiableSet
containing the namespaces of every registered advancement tab.- Returns:
- An unmodifiable
Set
containing the namespaces of every registered advancement tab. - Throws:
IllegalStateException
- If the API is not enabled.
-
filterNamespaces
@NotNull @Contract(pure=true, value="_ -> new") public @NotNull List<@NotNull String> filterNamespaces(@Nullable @Nullable String input) Returns the namespaced keys of every registered advancement which namespaced key starts with the provided one.- Parameters:
input
- The partial namespaced key that acts as a filter.- Returns:
- A filtered
List
that contains only the matching namespaced keys of the registered advancements. - Throws:
IllegalStateException
- If the API is not enabled.
-
getTabs
Returns an unmodifiableCollection
of every registered advancement tab.- Returns:
- An unmodifiable
Collection
of every registered advancement tab. - Throws:
IllegalStateException
- If the API is not enabled.
-
updatePlayer
Updates every advancement to a player.An advancement is updated only if its tab is shown to the player (see
AdvancementTab.isShownTo(Player)
).- Parameters:
player
- The player to be updated.- Throws:
IllegalStateException
- If the API is not enabled.
-
getAdvancement
Returns the advancement with the provided namespaced key.- Parameters:
namespacedKey
- The namespaced key of the advancement. It must be in the format"namespace:key"
.- Returns:
- The advancement with the provided namespaced key., or
null
if it doesn't exist. - Throws:
IllegalStateException
- If the API is not enabled.
-
getAdvancement
@Nullable public @Nullable Advancement getAdvancement(@NotNull @NotNull String namespace, @NotNull @NotNull String key) Returns the advancement with the provided namespaced key.- Parameters:
namespace
- The namespace of the advancement's tab.key
- The key of the advancement.- Returns:
- The advancement with the provided namespaced key, or
null
if it doesn't exist. - Throws:
IllegalStateException
- If the API is not enabled.
-
getAdvancement
@Nullable public @Nullable Advancement getAdvancement(@NotNull @NotNull AdvancementKey namespacedKey) Returns the advancement with the provided namespaced key.- Parameters:
namespacedKey
- TheAdvancementKey
of the advancement.- Returns:
- The advancement with the provided namespaced key, or
null
if it doesn't exist. - Throws:
IllegalStateException
- If the API is not enabled.
-
displayCustomToast
public void displayCustomToast(@NotNull @NotNull Player player, @NotNull @NotNull AdvancementDisplay display) Displays a custom toast notification to a player.- Parameters:
player
- The player the toast notification will be shown to.display
- TheAdvancementDisplay
that contains the graphic information to show.
-
displayCustomToast
public void displayCustomToast(@NotNull @NotNull Player player, @NotNull @NotNull ItemStack icon, @NotNull @NotNull String title, @NotNull @NotNull AdvancementFrameType frame) Displays a custom toast notification to a player.- Parameters:
player
- The player the toast notification will be shown to.icon
- The item of the toast notification.title
- The title of the toast notification.frame
- The shape of the toast notification frame.
-
disableVanillaAdvancements
Disables the vanilla advancements until next server restart or reload.- Throws:
RuntimeException
- If the operation fails. It is a wrapper for the real exception.
-
getTeamProgression
@NotNull public @NotNull TeamProgression getTeamProgression(@NotNull @NotNull Player player) throws UserNotLoadedException Returns theTeamProgression
of the team of the provided player.- Parameters:
player
- The player.- Returns:
- The
TeamProgression
of the player's team. - Throws:
UserNotLoadedException
- If the player was not loaded into the caching system. For more information about the caching system seeDatabaseManager
.
-
getTeamProgression
@NotNull public @NotNull TeamProgression getTeamProgression(@NotNull @NotNull UUID uuid) throws UserNotLoadedException Returns theTeamProgression
of the team of the provided player.- Parameters:
uuid
- TheUUID
of the player.- Returns:
- The
TeamProgression
of the player's team. - Throws:
UserNotLoadedException
- If the player was not loaded into the caching system. For more information about the caching system seeDatabaseManager
.
-
updatePlayerTeam
public void updatePlayerTeam(@NotNull @NotNull Player playerToMove, @NotNull @NotNull Player aDestTeamPlayer) Moves the provided player from their team to the second player's one.- Parameters:
playerToMove
- The player to move.aDestTeamPlayer
- A player of the destination team.
-
updatePlayerTeam
public void updatePlayerTeam(@NotNull @NotNull Player playerToMove, @NotNull @NotNull Player aDestTeamPlayer, @Nullable @Nullable Consumer<Result> action) Moves the provided player from their team to the second player's one. -
updatePlayerTeam
public void updatePlayerTeam(@NotNull @NotNull UUID playerToMove, @NotNull @NotNull UUID aDestTeamPlayer) Moves the provided player from their team to the second player's one. -
updatePlayerTeam
public void updatePlayerTeam(@NotNull @NotNull UUID playerToMove, @NotNull @NotNull UUID aDestTeamPlayer, @Nullable @Nullable Consumer<Result> action) Moves the provided player from their team to the second player's one. -
movePlayerInNewTeam
Moves the provided player into a new team.- Parameters:
playerToMove
- The player to be moved.
-
movePlayerInNewTeam
public void movePlayerInNewTeam(@NotNull @NotNull Player playerToMove, @Nullable @Nullable Consumer<ObjectResult<@NotNull TeamProgression>> action) Moves the provided player into a new team.- Parameters:
playerToMove
- The player to be moved.action
- AConsumer
that is called synchronously after the operation with anObjectResult
, which provides theTeamProgression
of the player's new team (when the operation is successful). If no code should be called, it can be put tonull
.
-
movePlayerInNewTeam
Moves the provided player into a new team.- Parameters:
playerToMove
- TheUUID
of the player to be moved.
-
movePlayerInNewTeam
public void movePlayerInNewTeam(@NotNull @NotNull UUID playerToMove, @Nullable @Nullable Consumer<ObjectResult<@NotNull TeamProgression>> action) Moves the provided player into a new team.- Parameters:
playerToMove
- TheUUID
of the player to be moved.action
- AConsumer
that is called synchronously after the operation with anObjectResult
, which provides theTeamProgression
of the player's new team (when the operation is successful). If no code should be called, it can be put tonull
.
-
unregisterOfflinePlayer
public void unregisterOfflinePlayer(@NotNull @NotNull OfflinePlayer player) throws IllegalStateException Unregisters the provided offline player, removing they from the database.They must be offline and not loaded into the caching system. For more information about the caching system see
DatabaseManager
.- Parameters:
player
- The offline player to unregister.- Throws:
IllegalStateException
- If the player is online or loaded into the caching system.
-
unregisterOfflinePlayer
public void unregisterOfflinePlayer(@NotNull @NotNull OfflinePlayer player, @Nullable @Nullable Consumer<Result> action) throws IllegalStateException Unregisters the provided offline player, removing they from the database.They must be offline and not loaded into the caching system. For more information about the caching system see
DatabaseManager
.- Parameters:
player
- The offline player to unregister.action
- AConsumer
that is called synchronously after the operation with aResult
. If no code should be called, it can be put tonull
.- Throws:
IllegalStateException
- If the player is online or loaded into the caching system.
-
unregisterOfflinePlayer
Unregisters the provided player, removing they from the database.They must be offline and not loaded into the caching system. For more information about the caching system see
DatabaseManager
.- Parameters:
uuid
- TheUUID
of the player to unregister.- Throws:
IllegalStateException
- If the player is online or loaded into the caching system.
-
unregisterOfflinePlayer
public void unregisterOfflinePlayer(@NotNull @NotNull UUID uuid, @Nullable @Nullable Consumer<Result> action) throws IllegalStateException Unregisters the provided player, removing they from the database.They must be offline and not loaded into the caching system. For more information about the caching system see
DatabaseManager
.- Parameters:
uuid
- TheUUID
of the player to unregister.action
- AConsumer
that is called synchronously after the operation with aResult
. If no code should be called, it can be put tonull
.- Throws:
IllegalStateException
- If the player is online or loaded into the caching system.
-
updatePlayerName
Updates the name of the specified player in the database.- Parameters:
player
- The player to update.
-
updatePlayerName
public void updatePlayerName(@NotNull @NotNull Player player, @Nullable @Nullable Consumer<Result> action) Updates the name of the specified player in the database. -
isUnredeemed
public void isUnredeemed(@NotNull @NotNull Advancement advancement, @NotNull @NotNull Player player, @NotNull @NotNull Consumer<ObjectResult<@NotNull Boolean>> action) Gets whether the provided advancement is unredeemed for the specified player.- Parameters:
advancement
- The advancement.player
- The player.action
- AConsumer
that is called synchronously after the operation with anObjectResult
, which provides theBoolean
result.
-
isUnredeemed
public void isUnredeemed(@NotNull @NotNull Advancement advancement, @NotNull @NotNull UUID uuid, @NotNull @NotNull Consumer<ObjectResult<@NotNull Boolean>> action) Returns whether the provided advancement is unredeemed for the specified team.- Parameters:
advancement
- The advancement.uuid
- TheUUID
of the player.action
- AConsumer
that is called synchronously after the operation with anObjectResult
, which provides theBoolean
result.
-
setUnredeemed
public void setUnredeemed(@NotNull @NotNull Advancement advancement, @NotNull @NotNull Player player) throws NotGrantedException Sets the provided advancement unredeemed for the specified player.Rewards will be given on redeem.
- Parameters:
advancement
- The advancement.player
- The player.- Throws:
NotGrantedException
- If the advancement is not granted for the specified player.
-
setUnredeemed
public void setUnredeemed(@NotNull @NotNull Advancement advancement, @NotNull @NotNull Player player, @Nullable @Nullable Consumer<Result> action) throws NotGrantedException Sets the provided advancement unredeemed for the specified player.Rewards will be given on redeem.
- Parameters:
advancement
- The advancement.player
- The player.action
- AConsumer
that is called synchronously after the operation with aResult
. If no code should be called, it can be put tonull
.- Throws:
NotGrantedException
- If the advancement is not granted for the specified player.
-
setUnredeemed
public void setUnredeemed(@NotNull @NotNull Advancement advancement, @NotNull @NotNull Player player, boolean giveRewards) throws NotGrantedException Sets the provided advancement unredeemed for the specified player.- Parameters:
advancement
- The advancement.player
- The player.giveRewards
- Whether to give rewards on redeem.- Throws:
NotGrantedException
- If the advancement is not granted for the specified player.
-
setUnredeemed
public void setUnredeemed(@NotNull @NotNull Advancement advancement, @NotNull @NotNull Player player, boolean giveRewards, @Nullable @Nullable Consumer<Result> action) throws NotGrantedException Sets the provided advancement unredeemed for the specified player.- Parameters:
advancement
- The advancement.player
- The player.giveRewards
- Whether to give rewards on redeem.action
- AConsumer
that is called synchronously after the operation with aResult
. If no code should be called, it can be put tonull
.- Throws:
NotGrantedException
- If the advancement is not granted for the specified player.
-
setUnredeemed
public void setUnredeemed(@NotNull @NotNull Advancement advancement, @NotNull @NotNull UUID uuid) throws NotGrantedException Sets the provided advancement unredeemed for the specified player.Rewards will be given on redeem.
- Parameters:
advancement
- The advancement.uuid
- TheUUID
of the player.- Throws:
NotGrantedException
- If the advancement is not granted for the specified player.
-
setUnredeemed
public void setUnredeemed(@NotNull @NotNull Advancement advancement, @NotNull @NotNull UUID uuid, @Nullable @Nullable Consumer<Result> action) throws NotGrantedException Sets the provided advancement unredeemed for the specified player.Rewards will be given on redeem.
- Parameters:
advancement
- The advancement.uuid
- TheUUID
of the player.action
- AConsumer
that is called synchronously after the operation with aResult
. If no code should be called, it can be put tonull
.- Throws:
NotGrantedException
- If the advancement is not granted for the specified player.
-
setUnredeemed
public void setUnredeemed(@NotNull @NotNull Advancement advancement, @NotNull @NotNull UUID uuid, boolean giveRewards) throws NotGrantedException Sets the provided advancement unredeemed for the specified player.- Parameters:
advancement
- The advancement.uuid
- TheUUID
of the player.giveRewards
- Whether to give rewards on redeem.- Throws:
NotGrantedException
- If the advancement is not granted for the specified player.
-
setUnredeemed
public void setUnredeemed(@NotNull @NotNull Advancement advancement, @NotNull @NotNull UUID uuid, boolean giveRewards, @Nullable @Nullable Consumer<Result> action) throws NotGrantedException Sets the provided advancement unredeemed for the specified player.- Parameters:
advancement
- The advancement.uuid
- TheUUID
of the player.giveRewards
- Whether to give rewards on redeem.action
- AConsumer
that is called synchronously after the operation with aResult
. If no code should be called, it can be put tonull
.- Throws:
NotGrantedException
- If the advancement is not granted for the specified player.
-
unsetUnredeemed
public void unsetUnredeemed(@NotNull @NotNull Advancement advancement, @NotNull @NotNull Player player) Redeems the specified advancement for the provided player.- Parameters:
advancement
- The advancement.player
- The player.
-
unsetUnredeemed
public void unsetUnredeemed(@NotNull @NotNull Advancement advancement, @NotNull @NotNull Player player, @Nullable @Nullable Consumer<Result> action) Redeems the specified advancement for the provided player. -
unsetUnredeemed
Redeems the specified advancement for the provided player.- Parameters:
advancement
- The advancement.uuid
- TheUUID
of the player.
-
unsetUnredeemed
public void unsetUnredeemed(@NotNull @NotNull Advancement advancement, @NotNull @NotNull UUID uuid, @Nullable @Nullable Consumer<Result> action) Redeems the specified advancement for the provided player. -
isLoaded
Returns whether the provided player is loaded into the caching system.For more information about the caching system see
DatabaseManager
.- Parameters:
player
- The player.- Returns:
- Whether the provided player is loaded into the caching system.
-
isLoaded
Returns whether the provided offline player is loaded into the caching system.For more information about the caching system see
DatabaseManager
.- Parameters:
player
- The offline player.- Returns:
- Whether the provided player is loaded into the caching system.
-
isLoaded
Returns whether the provided offline player is loaded into the caching system.For more information about the caching system see
DatabaseManager
.- Parameters:
uuid
- TheUUID
of the player.- Returns:
- Whether the provided player is loaded into the caching system.
-
loadOfflinePlayer
Loads the provided offline player from the database into the caching system.The offline player will be loaded manually (see
CacheFreeingOption.MANUAL(Plugin)
), sounloadOfflinePlayer(OfflinePlayer)
must be called to unload they.For more information about the caching system see
DatabaseManager
.- Parameters:
player
- The offline player to load.
-
loadOfflinePlayer
Loads the provided player from the database into the caching system.The player will be loaded manually (see
CacheFreeingOption.MANUAL(Plugin)
), sounloadOfflinePlayer(UUID)
must be called to unload they.For more information about the caching system see
DatabaseManager
.- Parameters:
uuid
- TheUUID
of the player to load.
-
loadOfflinePlayer
public void loadOfflinePlayer(@NotNull @NotNull OfflinePlayer player, @Nullable @Nullable Consumer<ObjectResult<@Nullable TeamProgression>> action) Loads the provided offline player from the database without putting they into the caching system (seeCacheFreeingOption.DONT_CACHE()
).The loaded
TeamProgression
can be retrieved through theConsumer
<ObjectResult
>.For more information about the caching system see
DatabaseManager
.- Parameters:
player
- The offline player to load.action
- AConsumer
that is called synchronously after the operation with anObjectResult
, which provides the loadedTeamProgression
.
-
loadOfflinePlayer
public void loadOfflinePlayer(@NotNull @NotNull UUID uuid, @Nullable @Nullable Consumer<ObjectResult<@Nullable TeamProgression>> action) Loads the provided player from the database without putting they into the caching system (seeCacheFreeingOption.DONT_CACHE()
).The loaded
TeamProgression
can be retrieved through theConsumer
<ObjectResult
>.For more information about the caching system see
DatabaseManager
.- Parameters:
uuid
- TheUUID
of the player to load.action
- AConsumer
that is called synchronously after the operation with anObjectResult
, which provides the loadedTeamProgression
.
-
loadOfflinePlayer
public void loadOfflinePlayer(@NotNull @NotNull OfflinePlayer player, @NotNull @NotNull CacheFreeingOption option, @Nullable @Nullable Consumer<ObjectResult<@Nullable TeamProgression>> action) Loads the provided offline player from the database with the specifiedCacheFreeingOption
.For more information about the
CacheFreeingOption
seeDatabaseManager.loadOfflinePlayer(UUID, CacheFreeingOption)
.For more information about the caching system see
DatabaseManager
.- Parameters:
player
- The offline player to load.option
- The chosenCacheFreeingOption
.action
- AConsumer
that is called synchronously after the operation with anObjectResult
, which provides the loadedTeamProgression
.
-
loadOfflinePlayer
public void loadOfflinePlayer(@NotNull @NotNull UUID uuid, @NotNull @NotNull CacheFreeingOption option, @Nullable @Nullable Consumer<ObjectResult<@Nullable TeamProgression>> action) Loads the provided player from the database with the specifiedCacheFreeingOption
.For more information about the
CacheFreeingOption
seeDatabaseManager.loadOfflinePlayer(UUID, CacheFreeingOption)
.For more information about the caching system see
DatabaseManager
.- Parameters:
uuid
- TheUUID
of the player to load.option
- The chosenCacheFreeingOption
.action
- AConsumer
that is called synchronously after the operation with anObjectResult
, which provides the loadedTeamProgression
.
-
isOfflinePlayerLoaded
Returns whether at least one loading request is currently active for the specified offline player.- Parameters:
player
- The offline player.- Returns:
- Whether at least one loading request is currently active for the specified offline player.
-
isOfflinePlayerLoaded
Returns whether at least one loading request is currently active for the specified player.- Parameters:
uuid
- TheUUID
of the player.- Returns:
- Whether at least one loading request is currently active for the specified player.
-
getLoadingRequestsAmount
public int getLoadingRequestsAmount(@NotNull @NotNull Player player, @NotNull CacheFreeingOption.Option type) Returns the number of currently active loading requests for the specified player with the providedCacheFreeingOption.Option
.- Parameters:
player
- The player.type
- TheCacheFreeingOption.Option
.- Returns:
- The number of the currently active player loading requests.
- See Also:
-
getLoadingRequestsAmount
public int getLoadingRequestsAmount(@NotNull @NotNull OfflinePlayer offlinePlayer, @NotNull CacheFreeingOption.Option type) Returns the number of currently active loading requests for the specified offline player with the providedCacheFreeingOption.Option
.- Parameters:
offlinePlayer
- The offline player.type
- TheCacheFreeingOption.Option
.- Returns:
- The number of the currently active player loading requests.
- See Also:
-
getLoadingRequestsAmount
public int getLoadingRequestsAmount(@NotNull @NotNull UUID uuid, @NotNull CacheFreeingOption.Option type) Returns the number of currently active loading requests for the specified player with the providedCacheFreeingOption.Option
.- Parameters:
uuid
- TheUUID
of the player.type
- TheCacheFreeingOption.Option
.- Returns:
- The number of the currently active player loading requests.
- See Also:
-
unloadOfflinePlayer
Removes one manual caching request for the provided offline player. If the counter reaches zero, they will be unloaded from the caching system.Note that this method will only unload players loaded with
CacheFreeingOption.MANUAL(Plugin)
.For more information about the caching system see
DatabaseManager
.- Parameters:
player
- The player to unload.
-
unloadOfflinePlayer
Removes one manual caching request for the provided player. If the counter reaches zero, they will be unloaded from the caching system.Note that this method will only unload players loaded with
CacheFreeingOption.MANUAL(Plugin)
.For more information about the caching system see
DatabaseManager
.- Parameters:
uuid
- TheUUID
of the player to unload.
-
getStoredPlayerName
public void getStoredPlayerName(@NotNull @NotNull OfflinePlayer player, @NotNull @NotNull Consumer<ObjectResult<@Nullable String>> action) Gets the in-database stored name of the provided player.- Parameters:
player
- The player.action
- AConsumer
that is called synchronously after the operation with anObjectResult
, which provides the in-database stored name of the player.
-
getStoredPlayerName
public void getStoredPlayerName(@NotNull @NotNull UUID uuid, @NotNull @NotNull Consumer<ObjectResult<@Nullable String>> action) Gets the in-database stored name of the provided player.- Parameters:
uuid
- TheUUID
of the player.action
- AConsumer
that is called synchronously after the operation with anObjectResult
, which provides the in-database stored name of the player.
-