LevelProgress

@ApiStatus.NonExtendable
interface LevelProgress(source)

Snapshot of a player's progress on a level track. The maximum level and experience requirements are the ones that apply to this player now, so they may differ between players on the same track.

Values are read together and may be stale right after a write, so don't cache them. Progress objects are equal if all their values are equal.

Create it with the builder:

LevelProgress.level(5).minLevel(1).build();
LevelProgress.level(5).minLevel(0).maxLevel(99).exp(10.0).expToNextLevel(100.0).build();

Since

0.10.0

Types

Link copied to clipboard
class Builder

Builder of LevelProgress, use LevelProgress.level to create it.

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val exp: Double

Experience within the current level, 0.0 if the track has no experience. See hasExp.

Link copied to clipboard
abstract val expToNextLevel: Double

Total experience required for the step from the current level to the next one, not the remaining part. 0.0 if the next level is free, -1 if the requirement is unknown or the level is maximal. See hasExpToNextLevel.

Link copied to clipboard
abstract val level: Int

Current level. Never lower than minLevel.

Link copied to clipboard
abstract val maxLevel: Int

The highest level the player can reach on the track, -1 if the level is unlimited. See hasMaxLevel. It may depend on the player, for example on their permissions or class.

Link copied to clipboard
abstract val minLevel: Int

The lowest level on the track, 0 or 1 depending on the plugin. It is the same for all players.

Functions

Link copied to clipboard
abstract fun hasExp(): Boolean

Returns false if the track has levels only, without experience.

Link copied to clipboard

Returns false if the experience required for the next level is unknown, or the level is maximal.

Link copied to clipboard
open fun hasMaxLevel(): Boolean

Returns false if the level is unlimited.