Class PlayerData
java.lang.Object
com.zetaplugins.cookieclickerz.storage.PlayerData
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUpgrade(String upgradeName, int level) getAchievement(AchievementType achievementType) Get an achievement by its typegetAchievement(String achievementSlug) Get an achievement by its slugGet the player's score formatted as a stringlonggetName()intgetScore()Get the player's scoreintintgetUpgradeLevel(String upgradeName) getUuid()booleanvoidprogressAchievement(AchievementType achievementType, int progressAmount, CookieClickerZ plugin) Progress an achievement by a certain amountvoidprogressCookiesAchievement(AchievementType achievementType, BigInteger totalCookies, CookieClickerZ plugin) voidvoidsetAchievementProgress(AchievementType achievementType, int progress) Set the progress of an achievementvoidsetAchievementProgress(AchievementType achievementType, int progressAmount, CookieClickerZ plugin) voidsetAchievementProgress(String achievementSlug, int progress) Set the progress of an achievementvoidsetAchievements(List<Achievement> achievements) voidsetCookiesPerClick(BigInteger cookiesPerClick) voidsetHasRemovedUpgrades(boolean removedUpgrades) voidsetLastLogoutTime(long lastLogoutTime) voidsetOfflineCookies(BigInteger offlineCookies) voidsetPrestige(int prestige) voidsetTotalClicks(int totalClicks) voidsetTotalCookies(BigInteger totalCookies) voidsetUpgrades(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
-