-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
14 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 8 additions & 17 deletions
25
src/main/java/me/xginko/snowballfight/events/SnowballEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters