1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-02 14:29:07 +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 // Global placeholders
switch (placeHolder) { switch (placeHolder) {
case maxjobs: 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: case total_workers:
return Integer.toString(Jobs.getJobsDAO().getTotalPlayers()); return Integer.toString(Jobs.getJobsDAO().getTotalPlayers());
default: default: