1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 05:55:27 +01:00

Solves issue #1772. Added 3 new placeholders.

Added 3 new placeholders:
%jobsr_jtop_name_total_[[1-15]]% -> Top list by total job levels, provided place in the list. Returns playername.

%jobsr_jtop_displayname_total_[[1-15]]% -> Top list by total job levels, provided place in the list. Returns player displayname.

%jobsr_jtop_level_total_[[1-15]]% -> Top list by total job levels, provided place in the list. Returns player total level.
This commit is contained in:
Nikkcom 2024-07-23 16:18:01 +02:00
parent b537ec4f36
commit 936d5ac53b

View File

@ -91,8 +91,11 @@ public class Placeholder {
user_archived_jobs_exp_$1("jname/number"),
jtop_name_$1_$2("jname/number", "[1-15]"),
jtop_name_total_$1("[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_total_$1("[1-15]"),
maxjobs,
total_workers,
@ -631,6 +634,26 @@ public class Placeholder {
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)
return "";
@ -651,6 +674,26 @@ public class Placeholder {
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)
return "";
@ -675,6 +718,26 @@ public class Placeholder {
return "";
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:
return jo.getName();
case shortname_$1: