diff --git a/src/main/java/com/gamingmesh/jobs/Jobs.java b/src/main/java/com/gamingmesh/jobs/Jobs.java index b8ca7926..7162e091 100644 --- a/src/main/java/com/gamingmesh/jobs/Jobs.java +++ b/src/main/java/com/gamingmesh/jobs/Jobs.java @@ -708,8 +708,6 @@ public class Jobs extends JavaPlugin { // register economy Bukkit.getScheduler().runTask(this, new HookEconomyTask(this)); - // all loaded properly. - dao.loadBlockProtection(); getExplore().load(); diff --git a/src/main/java/com/gamingmesh/jobs/container/JobsPlayer.java b/src/main/java/com/gamingmesh/jobs/container/JobsPlayer.java index d947030d..ef346b0d 100644 --- a/src/main/java/com/gamingmesh/jobs/container/JobsPlayer.java +++ b/src/main/java/com/gamingmesh/jobs/container/JobsPlayer.java @@ -1015,12 +1015,16 @@ public class JobsPlayer { int i = 0; while (i <= job.getQuests().size()) { ++i; + List currentQuests = new ArrayList<>(g.keySet()); Quest q = job.getNextQuest(currentQuests, getJobProgression(job).getLevel()); if (q == null) continue; + QuestProgression qp = new QuestProgression(q); - g.put(qp.getQuest().getConfigName().toLowerCase(), qp); + if (qp.getQuest() != null) + g.put(qp.getQuest().getConfigName().toLowerCase(), qp); + if (g.size() >= job.getMaxDailyQuests()) break; } diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java index 8fcfb484..9bc777f6 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java @@ -594,13 +594,19 @@ public class JobsPaymentListener implements Listener { // Checking if item is been repaired, not crafted. Combining 2 items ItemStack[] sourceItems = event.getInventory().getContents(); + // For dye check List DyeStack = new ArrayList<>(); + int y = -1; + CMIMaterial first = null; CMIMaterial second = null; CMIMaterial third = null; + boolean leather = false; + boolean shulker = false; + for (ItemStack s : sourceItems) { if (s == null) continue; @@ -611,6 +617,7 @@ public class JobsPaymentListener implements Listener { CMIMaterial mat = CMIMaterial.get(s); if (mat != CMIMaterial.NONE) { y++; + if (y == 0) first = mat; if (y == 1) @@ -627,6 +634,25 @@ public class JobsPaymentListener implements Listener { case LEATHER_HORSE_ARMOR: leather = true; break; + case SHULKER_BOX: + case BLACK_SHULKER_BOX: + case BLUE_SHULKER_BOX: + case BROWN_SHULKER_BOX: + case CYAN_SHULKER_BOX: + case GRAY_SHULKER_BOX: + case GREEN_SHULKER_BOX: + case LIGHT_BLUE_SHULKER_BOX: + case LIGHT_GRAY_SHULKER_BOX: + case LIME_SHULKER_BOX: + case MAGENTA_SHULKER_BOX: + case ORANGE_SHULKER_BOX: + case PINK_SHULKER_BOX: + case PURPLE_SHULKER_BOX: + case RED_SHULKER_BOX: + case WHITE_SHULKER_BOX: + case YELLOW_SHULKER_BOX: + shulker = true; + break; default: break; } @@ -645,11 +671,13 @@ public class JobsPaymentListener implements Listener { // Check Dyes if (y >= 2) { - if ((third != null && third.isDye() || second != null && second.isDye() || first != null && first.isDye()) && leather) { + if ((third != null && third.isDye() || second != null && second.isDye() || first != null && first.isDye()) + && (leather || shulker)) { Jobs.action(jPlayer, new ItemActionInfo(sourceItems[0], ActionType.DYE)); for (ItemStack OneDye : DyeStack) { Jobs.action(jPlayer, new ItemActionInfo(OneDye, ActionType.DYE)); } + return; } }