Class PlayerData
java.lang.Object
org.strassburger.cookieclickerz.storage.PlayerData
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addUpgrade
(String upgradeName, int level) getAchievement
(String achievementSlug) Get an achievement by its sluggetAchievement
(AchievementType achievementType) Get an achievement by its typeGet the player's score formatted as a stringlong
getName()
int
getScore()
Get the player's scoreint
int
getUpgradeLevel
(String upgradeName) getUuid()
boolean
void
progressAchievement
(AchievementType achievementType, int progressAmount, CookieClickerZ plugin) Progress an achievement by a certain amountvoid
progressCookiesAchievement
(AchievementType achievementType, BigInteger totalCookies, CookieClickerZ plugin) void
void
setAchievementProgress
(String achievementSlug, int progress) Set the progress of an achievementvoid
setAchievementProgress
(AchievementType achievementType, int progress) Set the progress of an achievementvoid
setAchievementProgress
(AchievementType achievementType, int progressAmount, CookieClickerZ plugin) void
setAchievements
(List<Achievement> achievements) void
setCookiesPerClick
(BigInteger cookiesPerClick) void
setHasRemovedUpgrades
(boolean removedUpgrades) void
setLastLogoutTime
(long lastLogoutTime) void
setOfflineCookies
(BigInteger offlineCookies) void
setPrestige
(int prestige) void
setTotalClicks
(int totalClicks) void
setTotalCookies
(BigInteger totalCookies) void
setUpgrades
(Map<String, Integer> upgrades)
-
Constructor Details
-
PlayerData
-
-
Method Details
-
getName
-
getUuid
-
getTotalCookies
-
setTotalCookies
- Throws:
IllegalArgumentException
-
getTotalClicks
public int getTotalClicks() -
setTotalClicks
public void setTotalClicks(int totalClicks) -
getLastLogoutTime
public long getLastLogoutTime() -
setLastLogoutTime
public void setLastLogoutTime(long lastLogoutTime) -
getUpgrades
-
setUpgrades
-
addUpgrade
-
getUpgradeLevel
-
resetUpgrades
public void resetUpgrades() -
hasRemovedUpgrades
public boolean hasRemovedUpgrades() -
setHasRemovedUpgrades
public void setHasRemovedUpgrades(boolean removedUpgrades) -
getAchievements
-
setAchievements
-
getAchievement
Get an achievement by its slug- Parameters:
achievementSlug
- The slug of the achievement to get- Returns:
- The achievement if found, otherwise an empty optional
-
getAchievement
Get an achievement by its type- Parameters:
achievementType
- The achievement type to get- Returns:
- The achievement if found, otherwise an empty optional
-
setAchievementProgress
public void setAchievementProgress(String achievementSlug, int progress) throws IllegalArgumentException Set the progress of an achievement- Parameters:
achievementSlug
- The slug of the achievement to set the progress forprogress
- The progress to set- Throws:
IllegalArgumentException
- If the achievement slug is invalid
-
setAchievementProgress
Set the progress of an achievement- Parameters:
achievementType
- The achievement type to set the progress forprogress
- The progress to set
-
setAchievementProgress
public void setAchievementProgress(AchievementType achievementType, int progressAmount, CookieClickerZ plugin) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
progressAchievement
public void progressAchievement(AchievementType achievementType, int progressAmount, CookieClickerZ plugin) Progress an achievement by a certain amount- Parameters:
achievementType
- The achievement type to progressprogressAmount
- The amount to progress the achievement byplugin
- The plugin instance
-
progressCookiesAchievement
public void progressCookiesAchievement(AchievementType achievementType, BigInteger totalCookies, CookieClickerZ plugin) -
getCookiesPerClick
-
setCookiesPerClick
- Throws:
IllegalArgumentException
-
getOfflineCookies
-
setOfflineCookies
- Throws:
IllegalArgumentException
-
getPrestige
public int getPrestige() -
setPrestige
public void setPrestige(int prestige) -
getScore
Get the player's score- Returns:
- The player's score
-
getFormattedScore
Get the player's score formatted as a string- Returns:
- The player's score formatted as a string
-