Skip to content

Commit

Permalink
⚡ Exclude players in adventure mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nkomarn committed Apr 20, 2020
1 parent 792328d commit 560f0f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/xyz/nkomarn/Harbor/task/Checker.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ private static List<Player> 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")
Expand All @@ -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();
}
}
1 change: 1 addition & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 560f0f1

Please sign in to comment.