forked from SteamWar/SteamWar
Merge pull request 'Refactor schematic checks to handle unseen notifications' (#33) from add-offline-notify into main
Reviewed-on: SteamWar/SteamWar#33 Reviewed-by: YoyoNow <yoyonow@noreply.localhost>
This commit is contained in:
@@ -87,10 +87,11 @@ public interface Chatter {
|
||||
}
|
||||
default void withPlayerOrOffline(Consumer<Player> withPlayer, Runnable withOffline) {
|
||||
Player player = getPlayer();
|
||||
if(player == null)
|
||||
if(player == null) {
|
||||
withOffline.run();
|
||||
else
|
||||
} else {
|
||||
withPlayer.accept(player);
|
||||
}
|
||||
}
|
||||
default void withPlayer(Consumer<Player> function) {
|
||||
withPlayerOrOffline(function, () -> {});
|
||||
|
||||
Reference in New Issue
Block a user