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:
2025-06-10 20:57:33 +02:00
4 changed files with 47 additions and 20 deletions
@@ -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, () -> {});