1
0
mirror of https://github.com/nkomarn/harbor.git synced 2025-01-20 14:31:30 +01:00

Exclude players in adventure mode

This commit is contained in:
Mykyta 2020-04-20 08:48:47 -07:00
parent 792328de46
commit 560f0f1a8d
No known key found for this signature in database
GPG Key ID: C147E30C19EA3570
2 changed files with 5 additions and 2 deletions

View File

@ -98,6 +98,8 @@ public class Checker implements Runnable {
}
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 @@ public class Checker implements Runnable {
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();
}
}

View File

@ -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