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

Fixed when the blacklist worlds not works for tntbreak action

This commit is contained in:
montlikadani 2020-04-27 19:06:43 +02:00
parent bedd3e5d97
commit e7f7c7deb0
4 changed files with 25 additions and 29 deletions

View File

@ -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<JobProgression> 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();

View File

@ -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");

View File

@ -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);
}

View File

@ -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);
}
}