From c9f77835daade7f274cc549a8fb1aa91404f9703 Mon Sep 17 00:00:00 2001 From: FireML <106587317+FireML@users.noreply.github.com> Date: Thu, 21 Mar 2024 12:16:52 +0000 Subject: [PATCH 1/2] Use the more detailed constructor for Jobs#perform event --- src/main/java/com/gamingmesh/jobs/Jobs.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gamingmesh/jobs/Jobs.java b/src/main/java/com/gamingmesh/jobs/Jobs.java index d7ff5129..4908d5ec 100644 --- a/src/main/java/com/gamingmesh/jobs/Jobs.java +++ b/src/main/java/com/gamingmesh/jobs/Jobs.java @@ -1453,7 +1453,8 @@ public final class Jobs extends JavaPlugin { payment.set(CurrencyType.MONEY, jobsPrePaymentEvent.getAmount()); payment.set(CurrencyType.POINTS, jobsPrePaymentEvent.getPoints()); - JobsExpGainEvent jobsExpGainEvent = new JobsExpGainEvent(payment.getOfflinePlayer(), job, expPayment); + JobsExpGainEvent jobsExpGainEvent = new JobsExpGainEvent(payment.getOfflinePlayer(), job, expPayment, + block, ent, victim, info); Bukkit.getServer().getPluginManager().callEvent(jobsExpGainEvent); // If event is canceled, don't do anything if (jobsExpGainEvent.isCancelled()) From 59b610137b5815642cd401a43e05be226b8a864e Mon Sep 17 00:00:00 2001 From: FireML <106587317+FireML@users.noreply.github.com> Date: Thu, 21 Mar 2024 12:18:33 +0000 Subject: [PATCH 2/2] Remove unused JobsExpGainEvent Constructor --- .../com/gamingmesh/jobs/api/JobsExpGainEvent.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/api/JobsExpGainEvent.java b/src/main/java/com/gamingmesh/jobs/api/JobsExpGainEvent.java index c5655d0a..31d686b9 100644 --- a/src/main/java/com/gamingmesh/jobs/api/JobsExpGainEvent.java +++ b/src/main/java/com/gamingmesh/jobs/api/JobsExpGainEvent.java @@ -24,16 +24,11 @@ public final class JobsExpGainEvent extends BaseEvent implements Cancellable { private boolean cancelled = false; - public JobsExpGainEvent(OfflinePlayer offlinePlayer, Job job, double exp) { - this.offlinePlayer = offlinePlayer; - this.job = job; - this.exp = exp; - } - public JobsExpGainEvent(OfflinePlayer offlinePlayer, Job job, double exp, Block block, Entity entity, LivingEntity living, ActionInfo info) { - this(offlinePlayer, job, exp); - + this.offlinePlayer = offlinePlayer; + this.job = job; + this.exp = exp; this.block = block; this.entity = entity; this.living = living;