diff --git a/src/main/java/com/gamingmesh/jobs/Jobs.java b/src/main/java/com/gamingmesh/jobs/Jobs.java index ba560d8e..aa8cd0d0 100644 --- a/src/main/java/com/gamingmesh/jobs/Jobs.java +++ b/src/main/java/com/gamingmesh/jobs/Jobs.java @@ -1399,7 +1399,9 @@ public class Jobs extends JavaPlugin { } public static void perform(JobsPlayer jPlayer, ActionInfo info, BufferedPayment payment, Job job) { - JobsExpGainEvent jobsExpGainEvent = new JobsExpGainEvent(payment.getOfflinePlayer(), job, payment.get(CurrencyType.EXP)); + double expPayment = payment.get(CurrencyType.EXP); + + JobsExpGainEvent jobsExpGainEvent = new JobsExpGainEvent(payment.getOfflinePlayer(), job, expPayment); Bukkit.getServer().getPluginManager().callEvent(jobsExpGainEvent); // If event is canceled, don't do anything if (jobsExpGainEvent.isCancelled()) @@ -1425,7 +1427,7 @@ public class Jobs extends JavaPlugin { getLoging().recordToLog(jPlayer, info, payment.getPayment()); } - if (prog.addExperience(payment.get(CurrencyType.EXP))) + if (prog.addExperience(expPayment)) getPlayerManager().performLevelUp(jPlayer, prog.getJob(), oldLevel); } diff --git a/src/main/java/com/gamingmesh/jobs/container/Job.java b/src/main/java/com/gamingmesh/jobs/container/Job.java index 4ef091c8..e79dd816 100644 --- a/src/main/java/com/gamingmesh/jobs/container/Job.java +++ b/src/main/java/com/gamingmesh/jobs/container/Job.java @@ -199,7 +199,8 @@ public class Job { * @return true if same */ public boolean isSame(Job job) { - return job != null && (id == job.getId() || fullName.equalsIgnoreCase(job.getName())); + return job != null && (id == job.getId() || jobName.equalsIgnoreCase(job.getName()) + || fullName.equalsIgnoreCase(job.getJobFullName()) || fullName.equalsIgnoreCase(job.getName())); } /** diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java index c99a5b74..d12208ca 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java @@ -275,8 +275,9 @@ public class JobsPaymentListener implements Listener { return; Sheep sheep = (Sheep) event.getEntity(); + // mob spawner, no payment or experience - if (sheep.hasMetadata(Jobs.getPlayerManager().getMobSpawnerMetadata()) && !Jobs.getGCManager().payNearSpawner()) { + if (!Jobs.getGCManager().payNearSpawner() && sheep.hasMetadata(Jobs.getPlayerManager().getMobSpawnerMetadata())) { sheep.removeMetadata(Jobs.getPlayerManager().getMobSpawnerMetadata(), plugin); return; } @@ -507,7 +508,7 @@ public class JobsPaymentListener implements Listener { } // mob spawner, no payment or experience - if (animal.hasMetadata(Jobs.getPlayerManager().getMobSpawnerMetadata()) && !Jobs.getGCManager().payNearSpawner()) { + if (!Jobs.getGCManager().payNearSpawner() && animal.hasMetadata(Jobs.getPlayerManager().getMobSpawnerMetadata())) { animal.removeMetadata(Jobs.getPlayerManager().getMobSpawnerMetadata(), plugin); return; }