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

Optimizing permission check

This commit is contained in:
Zrips 2021-06-21 17:35:40 +03:00
parent 2c5a906639
commit 51ad48fdef
2 changed files with 5 additions and 2 deletions

View File

@ -37,6 +37,7 @@ public class PermissionManager {
private enum prm { private enum prm {
// jobs_join_JOBNAME(remade("jobs.join.%JOBNAME%"), 60 * 1000), // jobs_join_JOBNAME(remade("jobs.join.%JOBNAME%"), 60 * 1000),
jobs_use(remade("jobs.use"), 2), jobs_use(remade("jobs.use"), 2),
jobs_paycreative(remade("jobs.paycreative"), 2),
// jobs_boost_JOBNAME_money(remade("jobs.boost.%JOBNAME%.money"), 60 * 1000), // jobs_boost_JOBNAME_money(remade("jobs.boost.%JOBNAME%.money"), 60 * 1000),
// jobs_boost_JOBNAME_exp(remade("jobs.boost.%JOBNAME%.exp"), 60 * 1000), // jobs_boost_JOBNAME_exp(remade("jobs.boost.%JOBNAME%.exp"), 60 * 1000),
// jobs_boost_JOBNAME_points(remade("jobs.boost.%JOBNAME%.points"), 60 * 1000), // jobs_boost_JOBNAME_points(remade("jobs.boost.%JOBNAME%.points"), 60 * 1000),

View File

@ -122,6 +122,7 @@ import net.Zrips.CMILib.Colors.CMIChatColor;
import net.Zrips.CMILib.Entities.CMIEntityType; import net.Zrips.CMILib.Entities.CMIEntityType;
import net.Zrips.CMILib.Items.CMIItemStack; import net.Zrips.CMILib.Items.CMIItemStack;
import net.Zrips.CMILib.Items.CMIMaterial; import net.Zrips.CMILib.Items.CMIMaterial;
import net.Zrips.CMILib.Logs.CMIDebug;
import net.Zrips.CMILib.Version.Version; import net.Zrips.CMILib.Version.Version;
public final class JobsPaymentListener implements Listener { public final class JobsPaymentListener implements Listener {
@ -423,7 +424,6 @@ public final class JobsPaymentListener implements Listener {
} }
Jobs.FASTPAYMENT.remove(player.getUniqueId()); Jobs.FASTPAYMENT.remove(player.getUniqueId());
} }
if (!payForItemDurabilityLoss(player)) if (!payForItemDurabilityLoss(player))
return; return;
@ -1728,8 +1728,10 @@ public final class JobsPaymentListener implements Listener {
} }
public static boolean payIfCreative(Player player) { public static boolean payIfCreative(Player player) {
if (!Jobs.getGCManager().payInCreative() && player.getGameMode() == GameMode.CREATIVE && !player.hasPermission("jobs.paycreative")) if (!Jobs.getGCManager().payInCreative() && player.getGameMode() == GameMode.CREATIVE && !Jobs.getPermissionManager().hasPermission(Jobs.getPlayerManager().getJobsPlayer(player),
"jobs.paycreative")) {
return false; return false;
}
return true; return true;
} }