1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-01 15:03:36 +01:00

Merge pull request #1795 from Nikkcom/master

Solves issue #1772. Added 3 new placeholders.
This commit is contained in:
Zrips 2024-08-15 13:34:37 +03:00 committed by GitHub
commit 79bda9176b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -91,8 +91,11 @@ public class Placeholder {
user_archived_jobs_exp_$1("jname/number"), user_archived_jobs_exp_$1("jname/number"),
jtop_name_$1_$2("jname/number", "[1-15]"), jtop_name_$1_$2("jname/number", "[1-15]"),
jtop_name_total_$1("[1-15]"),
jtop_displayname_$1_$2("jname/number", "[1-15]"), jtop_displayname_$1_$2("jname/number", "[1-15]"),
jtop_displayname_total_$1("[1-15]"),
jtop_level_$1_$2("jname/number", "[1-15]"), jtop_level_$1_$2("jname/number", "[1-15]"),
jtop_level_total_$1("[1-15]"),
maxjobs, maxjobs,
total_workers, total_workers,
@ -631,6 +634,26 @@ public class Placeholder {
List<TopList> list = Jobs.getJobsDAO().getTopListByJob(jo, 15); List<TopList> list = Jobs.getJobsDAO().getTopListByJob(jo, 15);
if (list.size() < place)
return "";
return list.get(place - 1).getPlayerInfo().getName();
case jtop_name_total_$1:
if (values.isEmpty())
return "";
place = 0;
try {
place = Integer.parseInt(values.get(0));
} catch (NumberFormatException e) {
return "";
}
if (place < 1)
return "";
list = Jobs.getJobsDAO().getGlobalTopList();
if (list.size() < place) if (list.size() < place)
return ""; return "";
@ -651,6 +674,26 @@ public class Placeholder {
list = Jobs.getJobsDAO().getTopListByJob(jo, 15); list = Jobs.getJobsDAO().getTopListByJob(jo, 15);
if (list.size() < place)
return "";
return list.get(place - 1).getPlayerInfo().getDisplayName();
case jtop_displayname_total_$1:
if (values.isEmpty())
return "";
place = 0;
try {
place = Integer.parseInt(values.get(0));
} catch (NumberFormatException e) {
return "";
}
if (place < 1)
return "";
list = Jobs.getJobsDAO().getGlobalTopList();
if (list.size() < place) if (list.size() < place)
return ""; return "";
@ -675,6 +718,26 @@ public class Placeholder {
return ""; return "";
return String.valueOf(list.get(place - 1).getLevel()); return String.valueOf(list.get(place - 1).getLevel());
case jtop_level_total_$1:
if (values.isEmpty())
return "";
place = 0;
try {
place = Integer.parseInt(values.get(0));
} catch (NumberFormatException e) {
return "";
}
if (place < 1)
return "";
list = Jobs.getJobsDAO().getGlobalTopList();
if (list.size() < place)
return "";
return String.valueOf(list.get(place - 1).getPlayerInfo().getJobsPlayer().getTotalLevels());
case name_$1: case name_$1:
return jo.getName(); return jo.getName();
case shortname_$1: case shortname_$1: