Class BoosterManager
java.lang.Object
nl.minetopiasdb.api.boosters.BoosterManager
Class responsible for managing boosters
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a boost to provided playervoidAdd multiple boosts to provided playervoidclearBoosts(UUID uuid, BoostType type) Remove all boosts that a player hasvoidDelete 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 BoosterManagerGet the instance of BoosterManagerGet the last activated boosterintgetTotalBoost(BoostType type) Get the total percentage of active boostsvoidPull the currently active boosters to the database.voidremoveBoost(int rowId) Remove the boost with provided idbooleanremoveBoost(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
-
addBoost
-
addBoost
-
removeBoost
public void removeBoost(int rowId) Remove the boost with provided id- Parameters:
rowId- id of booster
-
removeBoost
-
clearBoosts
-
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
-
getTotalBoost
Get the total percentage of active boosts- Parameters:
type- boost type- Returns:
- total boost percentage of active boosts
-