diff --git a/src/main/java/com/gamingmesh/jobs/Jobs.java b/src/main/java/com/gamingmesh/jobs/Jobs.java index 4edff8d1..7731d641 100644 --- a/src/main/java/com/gamingmesh/jobs/Jobs.java +++ b/src/main/java/com/gamingmesh/jobs/Jobs.java @@ -830,23 +830,21 @@ public class Jobs extends JavaPlugin { } public static void action(JobsPlayer jPlayer, ActionInfo info, Block block, Entity ent, LivingEntity victim) { - if (jPlayer == null) return; List progression = jPlayer.getJobProgression(); int numjobs = progression.size(); - // no job if (!isBpOk(jPlayer, info, block, true)) return; + // no job if (numjobs == 0) { - if (noneJob == null) return; - if (noneJob.isWorldBlackListed(block, ent) || noneJob.isWorldBlackListed(victim)) + if (noneJob.isWorldBlackListed(block) || noneJob.isWorldBlackListed(block, ent) || noneJob.isWorldBlackListed(victim)) return; JobInfo jobinfo = noneJob.getJobInfo(info, 1); @@ -942,8 +940,8 @@ public class Jobs extends JavaPlugin { FastPayment.clear(); for (JobProgression prog : progression) { - - if (prog.getJob().isWorldBlackListed(block, ent) || prog.getJob().isWorldBlackListed(victim)) + if (prog.getJob().isWorldBlackListed(block) || prog.getJob().isWorldBlackListed(block, ent) + || prog.getJob().isWorldBlackListed(victim)) continue; int level = prog.getLevel(); diff --git a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java index 8f6a6df9..e9e614c1 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java @@ -186,7 +186,7 @@ public class ConfigManager { "[actionType] can be any valid job action. Look lower for all possible action types", "[actionTarget] can be material name, block type, entity name and so on. This is defined in same way as any generic payable job action", "[amount] is how many times player should perform this action to complete quest"); - cfg.get(questPt + ".Objectives", "- Break;17-0;300"); + cfg.get(questPt + ".Objectives", "Break;17-0;300"); cfg.addComment(questPt + ".RewardCommands", "Command list to be performed after quest is finished.", "Use [playerName] to insert players name who finished that quest"); diff --git a/src/main/java/com/gamingmesh/jobs/container/QuestProgression.java b/src/main/java/com/gamingmesh/jobs/container/QuestProgression.java index 4c4ea34a..a79efcbc 100644 --- a/src/main/java/com/gamingmesh/jobs/container/QuestProgression.java +++ b/src/main/java/com/gamingmesh/jobs/container/QuestProgression.java @@ -7,7 +7,6 @@ import org.bukkit.Bukkit; import org.bukkit.event.server.ServerCommandEvent; import com.gamingmesh.jobs.Jobs; -import com.gamingmesh.jobs.stuff.Debug; public class QuestProgression { @@ -51,7 +50,7 @@ public class QuestProgression { return amountDone; } - public int getAmountDone(QuestObjective objective) { + public int getAmountDone(QuestObjective objective) { return done.getOrDefault(objective, 0); } diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java index 8786a4e0..d1a9b9ca 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java @@ -27,7 +27,6 @@ import com.gamingmesh.jobs.actions.*; import com.gamingmesh.jobs.api.JobsChunkChangeEvent; import com.gamingmesh.jobs.container.*; import com.gamingmesh.jobs.hooks.HookManager; -import com.gamingmesh.jobs.stuff.Debug; import com.gamingmesh.jobs.stuff.FurnaceBrewingHandling; import com.gamingmesh.jobs.stuff.FurnaceBrewingHandling.ownershipFeedback; import com.google.common.base.Objects; @@ -228,27 +227,27 @@ public class JobsPaymentListener implements Listener { JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(player); if (jPlayer == null) return; - - boolean found = false; - t: for (JobProgression prog : jPlayer.getJobProgression()) { - for (JobInfo info : jPlayer.getJobProgression(prog.getJob()).getJob().getJobInfo(ActionType.MILK)) { - if (info.getActionType() == ActionType.MILK) { - found = true; - break t; - } - } - for (Quest q : prog.getJob().getQuests()) { - if (q != null && q.hasAction(ActionType.MILK)) { - found = true; - break t; - } + + boolean found = false; + t: for (JobProgression prog : jPlayer.getJobProgression()) { + for (JobInfo info : jPlayer.getJobProgression(prog.getJob()).getJob().getJobInfo(ActionType.MILK)) { + if (info.getActionType() == ActionType.MILK) { + found = true; + break t; + } } - } - if (!found) { - return; - } + for (Quest q : prog.getJob().getQuests()) { + if (q != null && q.hasAction(ActionType.MILK)) { + found = true; + break t; + } + } + } + if (!found) { + return; + } if (Jobs.getGCManager().CowMilkingTimer > 0) { if (cow.hasMetadata(CowMetadata)) { @@ -1600,7 +1599,7 @@ public class JobsPaymentListener implements Listener { return; BlockActionInfo bInfo = new BlockActionInfo(block, ActionType.TNTBREAK); - Jobs.action(jPlayer, bInfo); + Jobs.action(jPlayer, bInfo, block); } }