diff --git a/src/main/java/com/gamingmesh/jobs/PermissionHandler.java b/src/main/java/com/gamingmesh/jobs/PermissionHandler.java index df0be789..3dc69424 100644 --- a/src/main/java/com/gamingmesh/jobs/PermissionHandler.java +++ b/src/main/java/com/gamingmesh/jobs/PermissionHandler.java @@ -87,6 +87,7 @@ public class PermissionHandler { for (JobConditions Condition : job.getConditions()) { boolean ok = true; + for (String oneReq : Condition.getRequiredPerm()) { if (!player.hasPermission(oneReq)) { ok = false; @@ -98,6 +99,7 @@ public class PermissionHandler { String jobName = oneReq.getKey(); int jobLevel = oneReq.getValue(); boolean found = false; + for (JobProgression oneJob : jPlayer.getJobProgression()) { if (oneJob.getJob().getName().equalsIgnoreCase(jobName)) found = true; @@ -106,12 +108,14 @@ public class PermissionHandler { break; } } + if (!found) ok = false; } if (!ok) continue; + for (Entry one : Condition.getPerformPerm().entrySet()) { String perm = one.getKey(); boolean node = one.getValue(); @@ -149,6 +153,7 @@ public class PermissionHandler { for (JobConditions Condition : prog.getJob().getConditions()) { boolean ok = true; + for (String oneReq : Condition.getRequiredPerm()) { if (!player.hasPermission(oneReq)) { ok = false; @@ -160,19 +165,24 @@ public class PermissionHandler { String jobName = oneReq.getKey(); int jobLevel = oneReq.getValue(); boolean found = false; + for (JobProgression oneJob : jPlayer.getJobProgression()) { if (oneJob.getJob().getName().equalsIgnoreCase(jobName)) found = true; + if (oneJob.getJob().getName().equalsIgnoreCase(jobName) && oneJob.getLevel() < jobLevel) { ok = false; break; } } + if (!found) ok = false; } + if (!ok) continue; + for (Entry one : Condition.getPerformPerm().entrySet()) { String perm = one.getKey(); boolean node = one.getValue(); diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java index 5107ab69..6bddb42f 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java @@ -813,7 +813,8 @@ public class JobsPaymentListener implements Listener { Inventory inv = event.getInventory(); // must be anvil inventory - if (!(inv instanceof AnvilInventory) && !(inv instanceof GrindstoneInventory) && !(inv instanceof StonecutterInventory)) + if (!(inv instanceof AnvilInventory) && (Version.isCurrentEqualOrHigher(Version.v1_14_R1) + && !(inv instanceof GrindstoneInventory) && !(inv instanceof StonecutterInventory))) return; int slot = event.getSlot();