From dfa564aa749f6f1b00c141a962654233db237052 Mon Sep 17 00:00:00 2001 From: Zrips Date: Tue, 8 Mar 2022 15:58:01 +0200 Subject: [PATCH] %jobsr_user_canjoin_$1% placeholder fix --- .../gamingmesh/jobs/Placeholders/Placeholder.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java b/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java index 8ebac041..51131915 100644 --- a/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java +++ b/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java @@ -29,6 +29,8 @@ import com.gamingmesh.jobs.container.blockOwnerShip.BlockOwnerShip; import com.gamingmesh.jobs.container.blockOwnerShip.BlockTypes; import com.gamingmesh.jobs.stuff.TimeManage; +import net.Zrips.CMILib.Logs.CMIDebug; + public class Placeholder { private Jobs plugin; @@ -588,16 +590,13 @@ public class Placeholder { if (job == null) return ""; - if (!Jobs.getCommandManager().hasJobPermission(player, job) || user.isInJob(job)) + if (!Jobs.getCommandManager().hasJobPermission(player, job) || + user.isInJob(job) || + job.getMaxSlots() != null && Jobs.getUsedSlots(job) >= job.getMaxSlots() || + !job.isIgnoreMaxJobs() && !Jobs.getPlayerManager().getJobsLimit(user, (short) user.progression.size())) return convert(false); - if (job.getMaxSlots() != null && Jobs.getUsedSlots(job) >= job.getMaxSlots()) - return convert(false); - - int confMaxJobs = Jobs.getGCManager().getMaxJobs(); - short playerMaxJobs = (short) user.progression.size(); - return convert(confMaxJobs > 0 && playerMaxJobs >= confMaxJobs - && !Jobs.getPlayerManager().getJobsLimit(user, playerMaxJobs)); + return convert(true); case maxjobs: return Integer.toString(Jobs.getPlayerManager().getMaxJobs(user));