diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/gtop.java b/src/main/java/com/gamingmesh/jobs/commands/list/gtop.java index df30114c..dc6bf2f1 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/gtop.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/gtop.java @@ -49,7 +49,9 @@ public class gtop implements Cmd { if (page < 1) page = 1; - List FullList = Jobs.getJobsDAO().getGlobalTopList(page * 15 - 15); + int st = (page * 15) - 15; + + List 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 ls = new ArrayList(); - int i = page * 15 - 15; + int i = st; for (TopList one : FullList) { i++; String playername = one.getPlayerName() != null ? one.getPlayerName() : "Unknown"; diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/top.java b/src/main/java/com/gamingmesh/jobs/commands/list/top.java index 2006c124..edac00a6 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/top.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/top.java @@ -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 FullList = Jobs.getJobsDAO().toplist(args[0], page * 15); + List 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 ls = new ArrayList(); - int i = (page * 15) - 15; + int i = st; for (TopList one : FullList) { i++; String playername = one.getPlayerName() != null ? one.getPlayerName() : "Unknown";