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

Added placeholders for total, pending and completed daily quests (#764)

This commit is contained in:
Pablo Villaverde 2020-04-27 21:57:00 +02:00 committed by GitHub
parent 74a97f5d34
commit a22c1d1bd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,6 +37,9 @@ public class Placeholder {
user_furncount,
user_maxfurncount,
user_doneq,
user_dailyquests_pending,
user_dailyquests_completed,
user_dailyquests_total,
user_seen,
user_totallevels,
user_issaved,
@ -380,6 +383,15 @@ public class Placeholder {
if (user != null) {
NumberFormat format = NumberFormat.getInstance(Locale.ENGLISH);
switch (placeHolder) {
case user_dailyquests_pending:
Integer pendingQuests = (int) user.getQuestProgressions().stream().filter(q -> !q.isCompleted()).count();
return Integer.toString(pendingQuests);
case user_dailyquests_completed:
Integer completedQuests = (int) user.getQuestProgressions().stream().filter(q -> q.isCompleted()).count();
return Integer.toString(completedQuests);
case user_dailyquests_total:
Integer dailyquests = user.getQuestProgressions().size();
return Integer.toString(dailyquests);
case user_id:
return Integer.toString(user.getUserId());
case user_bstandcount: