Package nl.minetopiasdb.api.boosters
Class BoosterManager
java.lang.Object
nl.minetopiasdb.api.boosters.BoosterManager
Class responsible for managing boosters
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a boost to provided playervoid
Add multiple boosts to provided playervoid
clearBoosts
(UUID uuid, BoostType type) Remove all boosts that a player hasvoid
Delete expired boostersGet a list of currently active boostersgetActiveBoosts
(BoostType type) Get a list of currently active boosters of a specific typeGet the boost bar for the specified boosttypegetBoosters
(UUID uuid, BoostType type) Get a list of all boosts a player hasstatic BoosterManager
Get the instance of BoosterManagerGet the last activated boosterint
getTotalBoost
(BoostType type) Get the total percentage of active boostsvoid
Pull the currently active boosters to the database.void
removeBoost
(int rowId) Remove the boost with provided idboolean
removeBoost
(UUID uuid, BoostType type, int percentage) Remove a booster with provided UUID and percentagestartBoost
(UUID uuid, BoostType type, int percentage) Start a booster
-
Constructor Details
-
BoosterManager
public BoosterManager()
-
-
Method Details
-
getInstance
Get the instance of BoosterManager- Returns:
- instance of booster manager
-
getBoosters
Get a list of all boosts a player has- Parameters:
uuid
- UUID of playertype
- boost type- Returns:
- list of boosts
-
addBoost
Add a boost to provided player- Parameters:
uuid
- uuid of playertype
- boost typepercentage
- percentage of the boost
-
addBoost
Add multiple boosts to provided player- Parameters:
uuid
- uuid of playertype
- boost typepercentage
- percentage of the boostamount
- amount of boosters that need to be added
-
removeBoost
public void removeBoost(int rowId) Remove the boost with provided id- Parameters:
rowId
- id of booster
-
removeBoost
Remove a booster with provided UUID and percentage- Parameters:
uuid
- uuid of playertype
- boost typepercentage
- percentage of boost- Returns:
- true if a boost was found and deleted
-
clearBoosts
Remove all boosts that a player has- Parameters:
uuid
- uuid of playertype
- boost type
-
getLastActivatedBoost
Get the last activated booster- Parameters:
type
- boost type- Returns:
- active boost object
-
getActiveBoosts
Get a list of currently active boosters- Returns:
- list of active boosts
-
getActiveBoosts
Get a list of currently active boosters of a specific type- Parameters:
type
- boost type- Returns:
- list of active boosts
-
startBoost
Start a booster- Parameters:
uuid
- uuid of booster activatortype
- boost typepercentage
- boost percentage- Returns:
- active boost object for the just activated boost object
-
pullActiveBoosts
public void pullActiveBoosts()Pull the currently active boosters to the database. Used on server startup and when a booster gets activated in a different MT server (and communicates that through the messagechannels) -
deleteExpiredBoosts
public void deleteExpiredBoosts()Delete expired boosters -
getBar
Get the boost bar for the specified boosttype- Parameters:
type
- boost type- Returns:
- boost bar
-
getTotalBoost
Get the total percentage of active boosts- Parameters:
type
- boost type- Returns:
- total boost percentage of active boosts
-