1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-04 23:37:49 +01:00

%jobsr_user_jobs% to show none job name if player has no jobs

This commit is contained in:
Zrips 2022-11-17 16:45:58 +02:00
parent bf06440811
commit f0d6576c77

View File

@ -467,14 +467,17 @@ public class Placeholder {
case user_archived_jobs: case user_archived_jobs:
return Integer.toString(user.getArchivedJobs().getArchivedJobs().size()); return Integer.toString(user.getArchivedJobs().getArchivedJobs().size());
case user_jobs: case user_jobs:
String jobNames = ""; StringBuilder jobNames = new StringBuilder();
for (JobProgression prog : user.progression) { for (JobProgression prog : user.progression) {
if (!jobNames.isEmpty()) { if (!jobNames.toString().isEmpty()) {
jobNames += LC.info_ListSpliter.getLocale(); jobNames.append(LC.info_ListSpliter.getLocale());
} }
jobNames += prog.getJob().getName(); jobNames.append(prog.getJob().getDisplayName());
} }
return jobNames; if (user.progression.isEmpty()) {
jobNames.append(Jobs.getNoneJob().getDisplayName());
}
return jobNames.toString();
case user_quests: case user_quests:
String q = ""; String q = "";
for (QuestProgression questProg : user.getQuestProgressions()) { for (QuestProgression questProg : user.getQuestProgressions()) {