1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-30 21:07:48 +01:00

Max jobs placeholder should return the permission value

Fixes #983
This commit is contained in:
montlikadani 2020-11-16 18:34:25 +01:00
parent d70d2e7918
commit d019cbafb1

View File

@ -622,7 +622,9 @@ public class Placeholder {
// Global placeholders
switch (placeHolder) {
case maxjobs:
return Integer.toString(Jobs.getGCManager().getMaxJobs());
int max = Jobs.getPermissionManager().getMaxPermission(user, "jobs.max", false).intValue();
max = max == 0 ? Jobs.getGCManager().getMaxJobs() : max;
return Integer.toString(max);
case total_workers:
return Integer.toString(Jobs.getJobsDAO().getTotalPlayers());
default: