1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-01 15:03:36 +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("https://dev.bukkit.org/bukkit-plugins/iconomy-7/");
Bukkit.getServer().getLogger().severe("=============================================="); Bukkit.getServer().getLogger().severe("==============================================");
} }
private boolean setVault() { private boolean setVault() {
Plugin eco = Bukkit.getServer().getPluginManager().getPlugin("Vault"); Plugin eco = Bukkit.getServer().getPluginManager().getPlugin("Vault");
if (eco == null) if (eco == null)

View File

@ -996,6 +996,7 @@ public class Jobs extends JavaPlugin {
else else
expAmount = JobsExpGainEvent.getExp(); expAmount = JobsExpGainEvent.getExp();
Debug.D("income: " + income);
FastPayment.clear(); FastPayment.clear();
FastPayment.put(jPlayer.getUserName(), new FastPayment(jPlayer, info, new BufferedPayment(jPlayer.getPlayer(), income, pointAmount, expAmount), prog FastPayment.put(jPlayer.getUserName(), new FastPayment(jPlayer, info, new BufferedPayment(jPlayer.getPlayer(), income, pointAmount, expAmount), prog
.getJob())); .getJob()));

View File

@ -376,13 +376,13 @@ public class JobsCommands implements CommandExecutor {
} }
if (job.getBoost().get(BoostType.EXP) != 0D) 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) 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) 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 (Jobs.getGCManager().useDynamicPayment)
if (job.getBonus() < 0) if (job.getBonus() < 0)

View File

@ -44,7 +44,7 @@ public class Job {
// limited items // limited items
private List<JobLimitedItems> jobLimitedItems; private List<JobLimitedItems> jobLimitedItems;
// job name // job name
private String jobName; private String jobName = "N/A";
// job short name (for use in multiple jobs) // job short name (for use in multiple jobs)
private String jobShortName; private String jobShortName;
// short description of the job // 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())) if (!Jobs.getPermissionHandler().hasWorldPermission(player, player.getLocation().getWorld().getName()))
return; return;
BlockActionInfo bInfo = new BlockActionInfo(block, ActionType.BREAK);
FastPayment fp = Jobs.FastPayment.get(player.getName()); FastPayment fp = Jobs.FastPayment.get(player.getName());
if (fp != null) { if (fp != null) {
if (fp.getTime() > System.currentTimeMillis()) { if (fp.getTime() > System.currentTimeMillis()) {
Jobs.perform(fp.getPlayer(), fp.getInfo(), fp.getPayment(), fp.getJob()); if (fp.getInfo().getName().equalsIgnoreCase(bInfo.getName()) ||
return; fp.getInfo().getNameWithSub().equalsIgnoreCase(bInfo.getNameWithSub())) {
Jobs.perform(fp.getPlayer(), fp.getInfo(), fp.getPayment(), fp.getJob());
return;
}
} }
Jobs.FastPayment.remove(player.getName()); Jobs.FastPayment.remove(player.getName());
} }
@ -294,7 +298,6 @@ public class JobsPaymentListener implements Listener {
if (jPlayer == null) if (jPlayer == null)
return; return;
BlockActionInfo bInfo = new BlockActionInfo(block, ActionType.BREAK);
Jobs.action(jPlayer, bInfo, block); Jobs.action(jPlayer, bInfo, block);
} }