1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 22:13:25 +01:00

Fix for gtop incorrect listing numbers

This commit is contained in:
Zrips 2020-10-29 13:40:27 +02:00
parent 874fd3ce5c
commit 9adcc1593e
2 changed files with 8 additions and 11 deletions

View File

@ -1362,15 +1362,12 @@ public enum CMIMaterial {
if (id == null)
return CMIMaterial.NONE;
Integer data = null;
Integer ids = null;
id = id.replaceAll("_| |minecraft:", "").toLowerCase();
if (id.contains(":")) {
try {
ids = Integer.parseInt(id.split(":")[0]);
data = Integer.parseInt(id.split(":")[1]);
Integer ids = Integer.parseInt(id.split(":")[0]);
Integer data = Integer.parseInt(id.split(":")[1]);
if (ids <= 0)
return CMIMaterial.NONE;
return get(ids, data);
@ -1378,7 +1375,7 @@ public enum CMIMaterial {
}
try {
data = Integer.parseInt(id.split(":")[1]);
Integer data = Integer.parseInt(id.split(":")[1]);
id = id.split(":")[0];
CMIMaterial mat = ItemManager.byName.get(id + ":" + data);
if (mat != null) {

View File

@ -50,7 +50,7 @@ public class gtop implements Cmd {
int amount = Jobs.getGCManager().JobsTopAmount;
PageInfo pi = new PageInfo(amount, Jobs.getPlayerManager().getPlayersCache().size(), page);
List<TopList> FullList = Jobs.getJobsDAO().getGlobalTopList(pi.getStart() - 1);
List<TopList> FullList = Jobs.getJobsDAO().getGlobalTopList(pi.getStart());
if (FullList.isEmpty()) {
sender.sendMessage(Jobs.getLanguage().getMessage("command.gtop.error.nojob"));
return true;