mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-29 05:55:27 +01:00
Merge pull request #1725 from FireML/fix-event
Fix NPEs for JobsExpGainEvent
This commit is contained in:
commit
abd04d9653
@ -1453,7 +1453,8 @@ public final class Jobs extends JavaPlugin {
|
|||||||
payment.set(CurrencyType.MONEY, jobsPrePaymentEvent.getAmount());
|
payment.set(CurrencyType.MONEY, jobsPrePaymentEvent.getAmount());
|
||||||
payment.set(CurrencyType.POINTS, jobsPrePaymentEvent.getPoints());
|
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);
|
Bukkit.getServer().getPluginManager().callEvent(jobsExpGainEvent);
|
||||||
// If event is canceled, don't do anything
|
// If event is canceled, don't do anything
|
||||||
if (jobsExpGainEvent.isCancelled())
|
if (jobsExpGainEvent.isCancelled())
|
||||||
|
@ -24,16 +24,11 @@ public final class JobsExpGainEvent extends BaseEvent implements Cancellable {
|
|||||||
|
|
||||||
private boolean cancelled = false;
|
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,
|
public JobsExpGainEvent(OfflinePlayer offlinePlayer, Job job, double exp, Block block,
|
||||||
Entity entity, LivingEntity living, ActionInfo info) {
|
Entity entity, LivingEntity living, ActionInfo info) {
|
||||||
this(offlinePlayer, job, exp);
|
this.offlinePlayer = offlinePlayer;
|
||||||
|
this.job = job;
|
||||||
|
this.exp = exp;
|
||||||
this.block = block;
|
this.block = block;
|
||||||
this.entity = entity;
|
this.entity = entity;
|
||||||
this.living = living;
|
this.living = living;
|
||||||
|
Loading…
Reference in New Issue
Block a user