diff --git a/src/main/java/me/xginko/snowballfight/events/PostSnowballExplodeEvent.java b/src/main/java/me/xginko/snowballfight/events/PostSnowballExplodeEvent.java index d4dc046..616cf75 100644 --- a/src/main/java/me/xginko/snowballfight/events/PostSnowballExplodeEvent.java +++ b/src/main/java/me/xginko/snowballfight/events/PostSnowballExplodeEvent.java @@ -23,14 +23,12 @@ public boolean hasExploded() { return hasExploded; } - @NotNull @Override - public HandlerList getHandlers() { + public @NotNull HandlerList getHandlers() { return handlers; } - @NotNull - public static HandlerList getHandlerList() { + public static @NotNull HandlerList getHandlerList() { return handlers; } } \ No newline at end of file diff --git a/src/main/java/me/xginko/snowballfight/events/PreSnowballExplodeEvent.java b/src/main/java/me/xginko/snowballfight/events/PreSnowballExplodeEvent.java index 0158938..ccf015b 100644 --- a/src/main/java/me/xginko/snowballfight/events/PreSnowballExplodeEvent.java +++ b/src/main/java/me/xginko/snowballfight/events/PreSnowballExplodeEvent.java @@ -50,14 +50,12 @@ public boolean isCancelled() { return isCancelled; } - @NotNull @Override - public HandlerList getHandlers() { + public @NotNull HandlerList getHandlers() { return handlers; } - @NotNull - public static HandlerList getHandlerList() { + public static @NotNull HandlerList getHandlerList() { return handlers; } } \ No newline at end of file diff --git a/src/main/java/me/xginko/snowballfight/events/SnowballEvent.java b/src/main/java/me/xginko/snowballfight/events/SnowballEvent.java index 8d7c815..bb3ff03 100644 --- a/src/main/java/me/xginko/snowballfight/events/SnowballEvent.java +++ b/src/main/java/me/xginko/snowballfight/events/SnowballEvent.java @@ -1,37 +1,28 @@ package me.xginko.snowballfight.events; import org.bukkit.entity.Snowball; -import org.bukkit.event.Event; import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; import org.jetbrains.annotations.NotNull; -public abstract class SnowballEvent extends Event { +public abstract class SnowballEvent extends EntityEvent { private static final @NotNull HandlerList handlers = new HandlerList(); - private final Snowball snowball; - - public SnowballEvent(boolean isAsync, Snowball snowball) { - super(isAsync); - this.snowball = snowball; - } - - public SnowballEvent(Snowball snowball) { - this.snowball = snowball; + public SnowballEvent(@NotNull Snowball snowball) { + super(snowball); } - public Snowball getSnowball() { - return snowball; + public @NotNull Snowball getSnowball() { + return (Snowball) entity; } - @NotNull @Override - public HandlerList getHandlers() { + public @NotNull HandlerList getHandlers() { return handlers; } - @NotNull - public static HandlerList getHandlerList() { + public static @NotNull HandlerList getHandlerList() { return handlers; } } diff --git a/src/main/java/me/xginko/snowballfight/events/SnowballExplodeEvent.java b/src/main/java/me/xginko/snowballfight/events/SnowballExplodeEvent.java index e01b693..4c0e643 100644 --- a/src/main/java/me/xginko/snowballfight/events/SnowballExplodeEvent.java +++ b/src/main/java/me/xginko/snowballfight/events/SnowballExplodeEvent.java @@ -46,14 +46,12 @@ public boolean getBreakBlocks() { return breakBlocks; } - @NotNull @Override - public HandlerList getHandlers() { + public @NotNull HandlerList getHandlers() { return handlers; } - @NotNull - public static HandlerList getHandlerList() { + public static @NotNull HandlerList getHandlerList() { return handlers; } }