From 560f0f1a8daa45936f14cef5b4328a7e87a815d4 Mon Sep 17 00:00:00 2001 From: Mykyta Date: Mon, 20 Apr 2020 08:48:47 -0700 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20Exclude=20players=20in=20adventure?= =?UTF-8?q?=20mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/xyz/nkomarn/Harbor/task/Checker.java | 6 ++++-- src/main/resources/config.yml | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/xyz/nkomarn/Harbor/task/Checker.java b/src/main/java/xyz/nkomarn/Harbor/task/Checker.java index 4741413..731acd0 100644 --- a/src/main/java/xyz/nkomarn/Harbor/task/Checker.java +++ b/src/main/java/xyz/nkomarn/Harbor/task/Checker.java @@ -98,6 +98,8 @@ private static List getExcluded(final World world) { } private static boolean isExcluded(final Player player) { + final boolean excludedByAdventure = Config.getBoolean("exclusions.exclude-adventure") + && player.getGameMode() == GameMode.ADVENTURE; final boolean excludedByCreative = Config.getBoolean("exclusions.exclude-creative") && player.getGameMode() == GameMode.CREATIVE; final boolean excludedBySpectator = Config.getBoolean("exclusions.exclude-spectator") @@ -107,7 +109,7 @@ private static boolean isExcluded(final Player player) { final boolean excludedByVanish = Config.getBoolean("exclusions.exclude-vanished") && isVanished(player); - return excludedByCreative || excludedBySpectator || excludedByPermission || excludedByVanish || - Afk.isAfk(player) || player.isSleepingIgnored(); + return excludedByAdventure || excludedByCreative || excludedBySpectator || excludedByPermission || + excludedByVanish || Afk.isAfk(player) || player.isSleepingIgnored(); } } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index bea948c..a766b0f 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -18,6 +18,7 @@ night-skip: exclusions: ignored-permission: true # Exclude players with the permission "harbor.ignored" from the sleeping count + exclude-adventure: true # Exclude players in adventure mode from the sleeping count exclude-creative: true # Exclude players in creative mode from the sleeping count exclude-spectator: true # Exclude players in spectator mode from the sleeping count exclude-vanished: true # Exclude vanished players from the sleeping count