Add EntityZapEvent

This commit is contained in:
AlphaBlend
2016-10-16 23:19:34 -07:00
parent 397d3cac4b
commit 4d7ecbdb78
2 changed files with 72 additions and 3 deletions

View File

@@ -12,14 +12,14 @@ import org.jetbrains.annotations.NotNull;
/**
* Stores data for pigs being zapped
*/
public class PigZapEvent extends EntityTransformEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
public class PigZapEvent extends com.destroystokyo.paper.event.entity.EntityZapEvent implements Cancellable { // Paper
// private static final HandlerList handlers = new HandlerList(); // Paper - moved in the super class
private boolean canceled;
private final PigZombie pigzombie;
private final LightningStrike bolt;
public PigZapEvent(@NotNull final Pig pig, @NotNull final LightningStrike bolt, @NotNull final PigZombie pigzombie) {
super(pig, Collections.singletonList((Entity) pigzombie), TransformReason.LIGHTNING);
super(pig, bolt, pigzombie); // Paper
this.bolt = bolt;
this.pigzombie = pigzombie;
}
@@ -63,6 +63,8 @@ public class PigZapEvent extends EntityTransformEvent implements Cancellable {
return pigzombie;
}
// Paper start
/*
@NotNull
@Override
public HandlerList getHandlers() {
@@ -73,4 +75,6 @@ public class PigZapEvent extends EntityTransformEvent implements Cancellable {
public static HandlerList getHandlerList() {
return handlers;
}
*/
// Paper end
}