diff --git a/src/main/java/com/gamingmesh/jobs/Jobs.java b/src/main/java/com/gamingmesh/jobs/Jobs.java index 1df5ccd7..5dc9a1ca 100644 --- a/src/main/java/com/gamingmesh/jobs/Jobs.java +++ b/src/main/java/com/gamingmesh/jobs/Jobs.java @@ -1027,7 +1027,8 @@ public class Jobs extends JavaPlugin { Boost boost = getPlayerManager().getFinalBonus(jPlayer, noneJob); - JobsPrePaymentEvent JobsPrePaymentEvent = new JobsPrePaymentEvent(jPlayer.getPlayer(), noneJob, income, pointAmount); + JobsPrePaymentEvent JobsPrePaymentEvent = new JobsPrePaymentEvent(jPlayer.getPlayer(), noneJob, income, + pointAmount, block, ent, victim, info); Bukkit.getServer().getPluginManager().callEvent(JobsPrePaymentEvent); // If event is canceled, don't do anything if (JobsPrePaymentEvent.isCancelled()) { @@ -1143,7 +1144,8 @@ public class Jobs extends JavaPlugin { Boost boost = getPlayerManager().getFinalBonus(jPlayer, prog.getJob(), ent, victim); - JobsPrePaymentEvent JobsPrePaymentEvent = new JobsPrePaymentEvent(jPlayer.getPlayer(), prog.getJob(), income, pointAmount); + JobsPrePaymentEvent JobsPrePaymentEvent = new JobsPrePaymentEvent(jPlayer.getPlayer(), noneJob, income, + pointAmount, block, ent, victim, info); Bukkit.getServer().getPluginManager().callEvent(JobsPrePaymentEvent); // If event is canceled, don't do anything if (JobsPrePaymentEvent.isCancelled()) { diff --git a/src/main/java/com/gamingmesh/jobs/api/JobsPrePaymentEvent.java b/src/main/java/com/gamingmesh/jobs/api/JobsPrePaymentEvent.java index 8ed236ea..726c6c53 100644 --- a/src/main/java/com/gamingmesh/jobs/api/JobsPrePaymentEvent.java +++ b/src/main/java/com/gamingmesh/jobs/api/JobsPrePaymentEvent.java @@ -1,7 +1,11 @@ package com.gamingmesh.jobs.api; +import com.gamingmesh.jobs.container.ActionInfo; import com.gamingmesh.jobs.container.Job; import org.bukkit.OfflinePlayer; +import org.bukkit.block.Block; +import org.bukkit.entity.Entity; +import org.bukkit.entity.LivingEntity; import org.bukkit.event.Cancellable; public final class JobsPrePaymentEvent extends BaseEvent implements Cancellable { @@ -9,8 +13,13 @@ public final class JobsPrePaymentEvent extends BaseEvent implements Cancellable private double money; private double points; private Job job; + private Block block; + private Entity entity; + private LivingEntity living; + private ActionInfo info; private boolean cancelled = false; + @Deprecated public JobsPrePaymentEvent(OfflinePlayer offlinePlayer, Job job, double money, double points) { this.job = job; this.offlinePlayer = offlinePlayer; @@ -18,6 +27,18 @@ public final class JobsPrePaymentEvent extends BaseEvent implements Cancellable this.points = points; } + public JobsPrePaymentEvent(OfflinePlayer offlinePlayer, Job job, double money, double points, Block block, + Entity entity, LivingEntity living, ActionInfo info) { + this.job = job; + this.offlinePlayer = offlinePlayer; + this.money = money; + this.points = points; + this.block = block; + this.entity = entity; + this.living = living; + this.info = info; + } + public OfflinePlayer getPlayer() { return offlinePlayer; } @@ -42,6 +63,22 @@ public final class JobsPrePaymentEvent extends BaseEvent implements Cancellable this.points = points; } + public Block getBlock() { + return block; + } + + public Entity getEntity() { + return entity; + } + + public LivingEntity getLivingEntity() { + return living; + } + + public ActionInfo getActionInfo() { + return info; + } + @Override public boolean isCancelled() { return cancelled;