java.lang.Object
tfagaming.projects.minecraft.homestead.models.Level

public final class Level extends Object
  • Field Details

  • Constructor Details

    • Level

      public Level(long regionId)
    • Level

      public Level(long id, long regionId, int level, long experience, long totalExperience, long createdAt)
  • Method Details

    • getXpForLevel

      public static long getXpForLevel(int level)
    • setAutoUpdate

      public void setAutoUpdate(boolean autoUpdate)
      Toggle Auto-Update for caching. If true, any call for setters will automatically update the cache. Otherwise, only the instance of the class will be updated.
      Parameters:
      autoUpdate - Auto-Update toggle
    • getUniqueId

      public long getUniqueId()
    • getRegionId

      public long getRegionId()
    • setRegionId

      public void setRegionId(long regionId)
    • getRegion

      @Nullable public @Nullable Region getRegion()
      Returns the region by directly fetching with region ID from cache.
      Returns:
      The region if found, null otherwise.
    • getRegionName

      public String getRegionName()
      Returns the region name safely by directly fetching with region ID from cache.
      Returns:
      The region name if found, "?" otherwise.
    • getLevel

      public int getLevel()
    • setLevel

      public void setLevel(int level)
    • getExperience

      public long getExperience()
    • getTotalExperience

      public long getTotalExperience()
    • getCreatedAt

      public long getCreatedAt()
    • getTotalXpForCurrentLevel

      public long getTotalXpForCurrentLevel()
    • getXpForNextLevel

      public long getXpForNextLevel()
    • getXpProgress

      public long getXpProgress()
    • getXpRemaining

      public long getXpRemaining()
    • getProgressPercentage

      public double getProgressPercentage()
    • addXp

      public void addXp(long amount)
    • setXp

      public void setXp(long experience)
    • removeXp

      public void removeXp(long amount)
    • reset

      public void reset()