A module-based leaderboard system for Spigot
Each entry in the leaderboard must be of type LeaderboardItem
& Comparable
to assist in sorting & formatting
As well as this, if you are provided an array of data from the leaderboard it is sorted (i.e. [0] is the first, [1] second, e.t.c.)
I've currently implemented some modules including:
- A sign module to update signs with a format (
SignModule
) - A HolographicDisplays module to have a hologram placeholder update with a format (
HolographicDisplaysModule
)
To make your own module you can simply implement LeaderboardModule
To register one of these modules, use Leaderboard.registerModule
or Leaderboard.registerModules
LeaderboardUpdateEvent
called on leader board update & provides typeLeaderboard
<dependency>
<groupId>com.birthdates</groupId>
<artifactId>leaderboards</artifactId>
<version>1.0.9</version>
<scope>compile</scope>
</dependency>
For a code example see here