mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-06 16:27:59 +01:00
Fixed when the blacklist worlds not works for tntbreak action
This commit is contained in:
parent
bedd3e5d97
commit
e7f7c7deb0
@ -830,23 +830,21 @@ public class Jobs extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void action(JobsPlayer jPlayer, ActionInfo info, Block block, Entity ent, LivingEntity victim) {
|
public static void action(JobsPlayer jPlayer, ActionInfo info, Block block, Entity ent, LivingEntity victim) {
|
||||||
|
|
||||||
if (jPlayer == null)
|
if (jPlayer == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
List<JobProgression> progression = jPlayer.getJobProgression();
|
List<JobProgression> progression = jPlayer.getJobProgression();
|
||||||
int numjobs = progression.size();
|
int numjobs = progression.size();
|
||||||
// no job
|
|
||||||
|
|
||||||
if (!isBpOk(jPlayer, info, block, true))
|
if (!isBpOk(jPlayer, info, block, true))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// no job
|
||||||
if (numjobs == 0) {
|
if (numjobs == 0) {
|
||||||
|
|
||||||
if (noneJob == null)
|
if (noneJob == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (noneJob.isWorldBlackListed(block, ent) || noneJob.isWorldBlackListed(victim))
|
if (noneJob.isWorldBlackListed(block) || noneJob.isWorldBlackListed(block, ent) || noneJob.isWorldBlackListed(victim))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
JobInfo jobinfo = noneJob.getJobInfo(info, 1);
|
JobInfo jobinfo = noneJob.getJobInfo(info, 1);
|
||||||
@ -942,8 +940,8 @@ public class Jobs extends JavaPlugin {
|
|||||||
FastPayment.clear();
|
FastPayment.clear();
|
||||||
|
|
||||||
for (JobProgression prog : progression) {
|
for (JobProgression prog : progression) {
|
||||||
|
if (prog.getJob().isWorldBlackListed(block) || prog.getJob().isWorldBlackListed(block, ent)
|
||||||
if (prog.getJob().isWorldBlackListed(block, ent) || prog.getJob().isWorldBlackListed(victim))
|
|| prog.getJob().isWorldBlackListed(victim))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int level = prog.getLevel();
|
int level = prog.getLevel();
|
||||||
|
@ -186,7 +186,7 @@ public class ConfigManager {
|
|||||||
"[actionType] can be any valid job action. Look lower for all possible action types",
|
"[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",
|
"[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");
|
"[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.",
|
cfg.addComment(questPt + ".RewardCommands", "Command list to be performed after quest is finished.",
|
||||||
"Use [playerName] to insert players name who finished that quest");
|
"Use [playerName] to insert players name who finished that quest");
|
||||||
|
@ -7,7 +7,6 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.event.server.ServerCommandEvent;
|
import org.bukkit.event.server.ServerCommandEvent;
|
||||||
|
|
||||||
import com.gamingmesh.jobs.Jobs;
|
import com.gamingmesh.jobs.Jobs;
|
||||||
import com.gamingmesh.jobs.stuff.Debug;
|
|
||||||
|
|
||||||
public class QuestProgression {
|
public class QuestProgression {
|
||||||
|
|
||||||
@ -51,7 +50,7 @@ public class QuestProgression {
|
|||||||
return amountDone;
|
return amountDone;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getAmountDone(QuestObjective objective) {
|
public int getAmountDone(QuestObjective objective) {
|
||||||
return done.getOrDefault(objective, 0);
|
return done.getOrDefault(objective, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@ import com.gamingmesh.jobs.actions.*;
|
|||||||
import com.gamingmesh.jobs.api.JobsChunkChangeEvent;
|
import com.gamingmesh.jobs.api.JobsChunkChangeEvent;
|
||||||
import com.gamingmesh.jobs.container.*;
|
import com.gamingmesh.jobs.container.*;
|
||||||
import com.gamingmesh.jobs.hooks.HookManager;
|
import com.gamingmesh.jobs.hooks.HookManager;
|
||||||
import com.gamingmesh.jobs.stuff.Debug;
|
|
||||||
import com.gamingmesh.jobs.stuff.FurnaceBrewingHandling;
|
import com.gamingmesh.jobs.stuff.FurnaceBrewingHandling;
|
||||||
import com.gamingmesh.jobs.stuff.FurnaceBrewingHandling.ownershipFeedback;
|
import com.gamingmesh.jobs.stuff.FurnaceBrewingHandling.ownershipFeedback;
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
@ -228,27 +227,27 @@ public class JobsPaymentListener implements Listener {
|
|||||||
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(player);
|
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(player);
|
||||||
if (jPlayer == null)
|
if (jPlayer == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
t: for (JobProgression prog : jPlayer.getJobProgression()) {
|
t: for (JobProgression prog : jPlayer.getJobProgression()) {
|
||||||
for (JobInfo info : jPlayer.getJobProgression(prog.getJob()).getJob().getJobInfo(ActionType.MILK)) {
|
for (JobInfo info : jPlayer.getJobProgression(prog.getJob()).getJob().getJobInfo(ActionType.MILK)) {
|
||||||
if (info.getActionType() == ActionType.MILK) {
|
if (info.getActionType() == ActionType.MILK) {
|
||||||
found = true;
|
found = true;
|
||||||
break t;
|
break t;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
for (Quest q : prog.getJob().getQuests()) {
|
|
||||||
if (q != null && q.hasAction(ActionType.MILK)) {
|
|
||||||
found = true;
|
|
||||||
break t;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!found) {
|
for (Quest q : prog.getJob().getQuests()) {
|
||||||
return;
|
if (q != null && q.hasAction(ActionType.MILK)) {
|
||||||
}
|
found = true;
|
||||||
|
break t;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!found) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (Jobs.getGCManager().CowMilkingTimer > 0) {
|
if (Jobs.getGCManager().CowMilkingTimer > 0) {
|
||||||
if (cow.hasMetadata(CowMetadata)) {
|
if (cow.hasMetadata(CowMetadata)) {
|
||||||
@ -1600,7 +1599,7 @@ public class JobsPaymentListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
BlockActionInfo bInfo = new BlockActionInfo(block, ActionType.TNTBREAK);
|
BlockActionInfo bInfo = new BlockActionInfo(block, ActionType.TNTBREAK);
|
||||||
Jobs.action(jPlayer, bInfo);
|
Jobs.action(jPlayer, bInfo, block);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user