mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-29 14:05:25 +01:00
Check block type for fast pay to avoid paying for different block types
This commit is contained in:
parent
458393b211
commit
40741d1a7d
@ -996,6 +996,7 @@ public class Jobs extends JavaPlugin {
|
||||
else
|
||||
expAmount = JobsExpGainEvent.getExp();
|
||||
|
||||
Debug.D("income: " + income);
|
||||
FastPayment.clear();
|
||||
FastPayment.put(jPlayer.getUserName(), new FastPayment(jPlayer, info, new BufferedPayment(jPlayer.getPlayer(), income, pointAmount, expAmount), prog
|
||||
.getJob()));
|
||||
|
@ -376,13 +376,13 @@ public class JobsCommands implements CommandExecutor {
|
||||
}
|
||||
|
||||
if (job.getBoost().get(BoostType.EXP) != 0D)
|
||||
message.append(ChatColor.GOLD + Jobs.getLanguage().getMessage("command.expboost.output.infostats", "%boost%", job.getBoost().get(BoostType.EXP)) + "\n");
|
||||
message.append(ChatColor.GOLD + Jobs.getLanguage().getMessage("command.expboost.output.infostats", "%boost%", (job.getBoost().get(BoostType.EXP)) + 1) + "\n");
|
||||
|
||||
if (job.getBoost().get(BoostType.MONEY) != 0D)
|
||||
message.append(ChatColor.GOLD + Jobs.getLanguage().getMessage("command.moneyboost.output.infostats", "%boost%", job.getBoost().get(BoostType.MONEY)) + "\n");
|
||||
message.append(ChatColor.GOLD + Jobs.getLanguage().getMessage("command.moneyboost.output.infostats", "%boost%", (job.getBoost().get(BoostType.MONEY)) + 1) + "\n");
|
||||
|
||||
if (job.getBoost().get(BoostType.POINTS) != 0D)
|
||||
message.append(ChatColor.GOLD + Jobs.getLanguage().getMessage("command.pointboost.output.infostats", "%boost%", job.getBoost().get(BoostType.POINTS)) + "\n");
|
||||
message.append(ChatColor.GOLD + Jobs.getLanguage().getMessage("command.pointboost.output.infostats", "%boost%", (job.getBoost().get(BoostType.POINTS)) + 1) + "\n");
|
||||
|
||||
if (Jobs.getGCManager().useDynamicPayment)
|
||||
if (job.getBonus() < 0)
|
||||
|
@ -44,7 +44,7 @@ public class Job {
|
||||
// limited items
|
||||
private List<JobLimitedItems> jobLimitedItems;
|
||||
// job name
|
||||
private String jobName;
|
||||
private String jobName = "N/A";
|
||||
// job short name (for use in multiple jobs)
|
||||
private String jobShortName;
|
||||
// short description of the job
|
||||
|
@ -270,12 +270,16 @@ public class JobsPaymentListener implements Listener {
|
||||
if (!Jobs.getPermissionHandler().hasWorldPermission(player, player.getLocation().getWorld().getName()))
|
||||
return;
|
||||
|
||||
BlockActionInfo bInfo = new BlockActionInfo(block, ActionType.BREAK);
|
||||
FastPayment fp = Jobs.FastPayment.get(player.getName());
|
||||
if (fp != null) {
|
||||
if (fp.getTime() > System.currentTimeMillis()) {
|
||||
if (fp.getInfo().getName().equalsIgnoreCase(bInfo.getName()) ||
|
||||
fp.getInfo().getNameWithSub().equalsIgnoreCase(bInfo.getNameWithSub())) {
|
||||
Jobs.perform(fp.getPlayer(), fp.getInfo(), fp.getPayment(), fp.getJob());
|
||||
return;
|
||||
}
|
||||
}
|
||||
Jobs.FastPayment.remove(player.getName());
|
||||
}
|
||||
|
||||
@ -294,7 +298,6 @@ public class JobsPaymentListener implements Listener {
|
||||
if (jPlayer == null)
|
||||
return;
|
||||
|
||||
BlockActionInfo bInfo = new BlockActionInfo(block, ActionType.BREAK);
|
||||
Jobs.action(jPlayer, bInfo, block);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user