1
0
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:
Zrips 2016-12-02 15:00:58 +02:00
parent 458393b211
commit 40741d1a7d
5 changed files with 12 additions and 8 deletions

View File

@ -54,7 +54,7 @@ public class HookEconomyTask implements Runnable {
Bukkit.getServer().getLogger().severe("https://dev.bukkit.org/bukkit-plugins/iconomy-7/");
Bukkit.getServer().getLogger().severe("==============================================");
}
private boolean setVault() {
Plugin eco = Bukkit.getServer().getPluginManager().getPlugin("Vault");
if (eco == null)

View File

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

View File

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

View File

@ -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

View File

@ -270,11 +270,15 @@ 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()) {
Jobs.perform(fp.getPlayer(), fp.getInfo(), fp.getPayment(), fp.getJob());
return;
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);
}