Skip to content

Commit

Permalink
Allow null in the listener.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wertik committed Sep 5, 2020
1 parent 3b34b1b commit 8435931
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,14 @@ public void registerListeners() {
registerListener(MessageType.JOIN, new Listener() {
@EventHandler
public void onJoin(PlayerJoinEvent event) {
if (handle(event.getPlayer(), MessageType.JOIN) != null)
event.setJoinMessage(handle(event.getPlayer(), MessageType.JOIN));
event.setJoinMessage(handle(event.getPlayer(), MessageType.JOIN));
}
});

registerListener(MessageType.LEAVE, new Listener() {
@EventHandler
public void onLeave(PlayerQuitEvent event) {
if (handle(event.getPlayer(), MessageType.LEAVE) != null)
event.setQuitMessage(handle(event.getPlayer(), MessageType.LEAVE));
event.setQuitMessage(handle(event.getPlayer(), MessageType.LEAVE));
}
});

Expand Down

0 comments on commit 8435931

Please sign in to comment.