Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit d4f9947

Browse files
committed
move logic
1 parent cd54785 commit d4f9947

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

src/main/java/com/epicplayera10/joinguard/listeners/LoginListener.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,26 @@ public void onPreLogin(AsyncPlayerPreLoginEvent event) {
3838

3939
// Track alts
4040
trackAltAccount(ipAddress, playerUuid);
41-
42-
// Check if player is whitelisted
43-
if (JoinGuard.instance().pluginConfiguration().whitelistedNicks.contains(playerName)) {
44-
return;
45-
}
4641

4742
String hashedIp = hashIp(ipAddress);
4843
boolean isPlayerBlocked = isPlayerBlocked(playerName, playerUuid, hashedIp);
4944

5045
// Check if the player is blocked
5146
if (isPlayerBlocked) {
5247
if (JoinGuard.instance().pluginConfiguration().standbyMode) {
48+
// Standby mode
5349
Bukkit.broadcast(
5450
Component.text("[JoinGuard] ").color(NamedTextColor.AQUA)
5551
.append(Component.text("Player " + playerName + " is on JoinGuard!").color(NamedTextColor.RED)),
5652
"joinguard.notify.join"
5753
);
5854
} else {
59-
// Disallow player from joining
60-
String kickMessage = ChatUtils.colorize("&cThis server is protected by JoinGuard");
61-
event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_BANNED, kickMessage);
55+
// Check if player is whitelisted
56+
if (!JoinGuard.instance().pluginConfiguration().whitelistedNicks.contains(playerName)) {
57+
// Disallow player from joining
58+
String kickMessage = ChatUtils.colorize("&cThis server is protected by JoinGuard");
59+
event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_BANNED, kickMessage);
60+
}
6261
}
6362
// Send the attempt message
6463
JoinGuardAPI.sendAttemptMessage(playerName, playerUuid, ipAddress).whenComplete((v, e) -> {

0 commit comments

Comments
 (0)