Class PlayerData

java.lang.Object
org.strassburger.cookieclickerz.storage.PlayerData

public final class PlayerData extends Object
  • Constructor Details

    • PlayerData

      public PlayerData(String name, UUID uuid)
  • Method Details

    • getName

      public String getName()
    • getUuid

      public UUID getUuid()
    • getTotalCookies

      public BigInteger getTotalCookies()
    • setTotalCookies

      public void setTotalCookies(BigInteger totalCookies) throws IllegalArgumentException
      Throws:
      IllegalArgumentException
    • getTotalClicks

      public int getTotalClicks()
    • setTotalClicks

      public void setTotalClicks(int totalClicks)
    • getLastLogoutTime

      public long getLastLogoutTime()
    • setLastLogoutTime

      public void setLastLogoutTime(long lastLogoutTime)
    • getUpgrades

      public Map<String,Integer> getUpgrades()
    • setUpgrades

      public void setUpgrades(Map<String,Integer> upgrades)
    • addUpgrade

      public void addUpgrade(String upgradeName, int level)
    • getUpgradeLevel

      public int getUpgradeLevel(String upgradeName)
    • resetUpgrades

      public void resetUpgrades()
    • hasRemovedUpgrades

      public boolean hasRemovedUpgrades()
    • setHasRemovedUpgrades

      public void setHasRemovedUpgrades(boolean removedUpgrades)
    • getAchievements

      public List<Achievement> getAchievements()
    • setAchievements

      public void setAchievements(List<Achievement> achievements)
    • getAchievement

      public Optional<Achievement> getAchievement(String achievementSlug)
      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

      public Optional<Achievement> getAchievement(AchievementType achievementType)
      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 for
      progress - The progress to set
      Throws:
      IllegalArgumentException - If the achievement slug is invalid
    • setAchievementProgress

      public void setAchievementProgress(AchievementType achievementType, int progress)
      Set the progress of an achievement
      Parameters:
      achievementType - The achievement type to set the progress for
      progress - 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 progress
      progressAmount - The amount to progress the achievement by
      plugin - The plugin instance
    • progressCookiesAchievement

      public void progressCookiesAchievement(AchievementType achievementType, BigInteger totalCookies, CookieClickerZ plugin)
    • getCookiesPerClick

      public BigInteger getCookiesPerClick()
    • setCookiesPerClick

      public void setCookiesPerClick(BigInteger cookiesPerClick) throws IllegalArgumentException
      Throws:
      IllegalArgumentException
    • getOfflineCookies

      public BigInteger getOfflineCookies()
    • setOfflineCookies

      public void setOfflineCookies(BigInteger offlineCookies) throws IllegalArgumentException
      Throws:
      IllegalArgumentException
    • getPrestige

      public int getPrestige()
    • setPrestige

      public void setPrestige(int prestige)
    • getScore

      public BigDecimal getScore()
      Get the player's score
      Returns:
      The player's score
    • getFormattedScore

      public String getFormattedScore()
      Get the player's score formatted as a string
      Returns:
      The player's score formatted as a string