1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-31 21:37:57 +01:00

Wrong top list start point

This commit is contained in:
Zrips 2017-07-02 13:33:38 +03:00
parent 4f634c900f
commit a88e733851
2 changed files with 9 additions and 6 deletions

View File

@ -49,7 +49,9 @@ public class gtop implements Cmd {
if (page < 1)
page = 1;
List<TopList> FullList = Jobs.getJobsDAO().getGlobalTopList(page * 15 - 15);
int st = (page * 15) - 15;
List<TopList> FullList = Jobs.getJobsDAO().getGlobalTopList(st);
if (FullList.size() <= 0) {
sender.sendMessage(ChatColor.RED + Jobs.getLanguage().getMessage("command.gtop.error.nojob"));
return false;
@ -57,7 +59,7 @@ public class gtop implements Cmd {
if (!Jobs.getGCManager().ShowToplistInScoreboard) {
sender.sendMessage(Jobs.getLanguage().getMessage("command.gtop.output.topline"));
int i = page * 15 - 15;
int i = st;
for (TopList One : FullList) {
i++;
String PlayerName = One.getPlayerName() != null ? One.getPlayerName() : "Unknown";
@ -68,7 +70,7 @@ public class gtop implements Cmd {
List<String> ls = new ArrayList<String>();
int i = page * 15 - 15;
int i = st;
for (TopList one : FullList) {
i++;
String playername = one.getPlayerName() != null ? one.getPlayerName() : "Unknown";

View File

@ -57,8 +57,9 @@ public class top implements Cmd {
player.sendMessage(ChatColor.RED + Jobs.getLanguage().getMessage("command.top.error.nojob"));
return false;
}
int st = (page * 15) - 15;
List<TopList> FullList = Jobs.getJobsDAO().toplist(args[0], page * 15);
List<TopList> FullList = Jobs.getJobsDAO().toplist(args[0], st);
if (FullList.size() <= 0) {
player.sendMessage(ChatColor.RED + Jobs.getLanguage().getMessage("general.error.noinfo"));
return false;
@ -71,7 +72,7 @@ public class top implements Cmd {
if (!Jobs.getGCManager().ShowToplistInScoreboard) {
player.sendMessage(Jobs.getLanguage().getMessage("command.top.output.topline", "%jobname%", jobName));
int i = (page * 15) - 15;
int i = st;
for (TopList One : FullList) {
i++;
String PlayerName = One.getPlayerName() != null ? One.getPlayerName() : "Unknown";
@ -83,7 +84,7 @@ public class top implements Cmd {
List<String> ls = new ArrayList<String>();
int i = (page * 15) - 15;
int i = st;
for (TopList one : FullList) {
i++;
String playername = one.getPlayerName() != null ? one.getPlayerName() : "Unknown";