|
@@ -2,6 +2,7 @@ package com.gmail.nossr50.runnables.commands;
|
|
|
|
|
|
import com.gmail.nossr50.datatypes.database.PlayerStat;
|
|
|
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
|
|
+import com.gmail.nossr50.mcMMO;
|
|
|
import org.apache.commons.lang.Validate;
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
import org.bukkit.entity.Player;
|
|
@@ -9,13 +10,16 @@ import org.bukkit.scheduler.BukkitRunnable;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
-public class MctopCommandAsyncTask extends BukkitRunnable {
|
|
|
+public class LeaderboardsCommandAsyncTask extends BukkitRunnable {
|
|
|
+ private final mcMMO pluginRef;
|
|
|
private final CommandSender sender;
|
|
|
private final PrimarySkillType skill;
|
|
|
private final int page;
|
|
|
private final boolean useBoard, useChat;
|
|
|
|
|
|
- public MctopCommandAsyncTask(int page, PrimarySkillType skill, CommandSender sender, boolean useBoard, boolean useChat) {
|
|
|
+ public LeaderboardsCommandAsyncTask(mcMMO pluginRef, int page, PrimarySkillType skill, CommandSender sender, boolean useBoard, boolean useChat) {
|
|
|
+ this.pluginRef = pluginRef;
|
|
|
+
|
|
|
Validate.isTrue(useBoard || useChat, "Attempted to start a rank retrieval with both board and chat off");
|
|
|
Validate.notNull(sender, "Attempted to start a rank retrieval with no recipient");
|
|
|
|
|
@@ -34,6 +38,6 @@ public class MctopCommandAsyncTask extends BukkitRunnable {
|
|
|
public void run() {
|
|
|
final List<PlayerStat> userStats = pluginRef.getDatabaseManager().readLeaderboard(skill, page, 10);
|
|
|
|
|
|
- new MctopCommandDisplayTask(userStats, page, skill, sender, useBoard, useChat).runTaskLater(pluginRef, 1);
|
|
|
+ new LeaderboardsCommandDisplayTask(pluginRef, userStats, page, skill, sender, useBoard, useChat).runTaskLater(pluginRef, 1);
|
|
|
}
|
|
|
}
|