Skip to content

Commit 76a65cf

Browse files
committed
remove no player sign on player list ping
1 parent 5d1eff2 commit 76a65cf

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

src/main/kotlin/li/angu/challengeplugin/listeners/ServerListPingListener.kt

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,47 +18,42 @@ class ServerListPingListener(private val plugin: ChallengePluginPlugin) : Listen
1818
.append(Component.text("Angu.li", NamedTextColor.YELLOW, TextDecoration.BOLD))
1919
.append(Component.text("", NamedTextColor.GOLD, TextDecoration.BOLD))
2020
.append(Component.text("since 2014", NamedTextColor.GRAY, TextDecoration.BOLD))
21-
21+
2222
val line2 = Component.text("» ", NamedTextColor.GREEN, TextDecoration.BOLD)
2323
.append(Component.text("New Challenge Update", NamedTextColor.WHITE, TextDecoration.BOLD))
2424
.append(Component.text(" «", NamedTextColor.GREEN, TextDecoration.BOLD))
25-
25+
2626
val motd = Component.text()
2727
.append(line1)
2828
.append(Component.newline())
2929
.append(line2)
3030
.build()
31-
31+
3232
event.motd(motd)
33-
33+
3434
// Easter egg in player count hover - customize the listed players
3535
val listedPlayers = event.listedPlayers
3636
listedPlayers.clear()
37-
37+
3838
// Add easter egg messages first
3939
listedPlayers.add(PaperServerListPingEvent.ListedPlayerInfo("§7─────────────────", UUID.randomUUID()))
4040
listedPlayers.add(PaperServerListPingEvent.ListedPlayerInfo("§6✦ Welcome to Angu.li! ✦", UUID.randomUUID()))
4141
listedPlayers.add(PaperServerListPingEvent.ListedPlayerInfo("§eChallenge yourself today!", UUID.randomUUID()))
4242
listedPlayers.add(PaperServerListPingEvent.ListedPlayerInfo("§7─────────────────", UUID.randomUUID()))
4343

4444
val onlinePlayers = plugin.server.onlinePlayers
45-
45+
4646
if (onlinePlayers.isNotEmpty()) {
4747
// Add actual online players (limit to 8 to leave room for easter egg)
4848
onlinePlayers.take(8).forEach { player ->
4949
listedPlayers.add(PaperServerListPingEvent.ListedPlayerInfo(player.name, player.uniqueId))
5050
}
51-
51+
5252
// If there are more than 8 players, show count
5353
if (onlinePlayers.size > 8) {
5454
val remaining = onlinePlayers.size - 8
5555
listedPlayers.add(PaperServerListPingEvent.ListedPlayerInfo("§7... and $remaining more", UUID.randomUUID()))
5656
}
57-
} else {
58-
// When no players are online, show special invite message
59-
listedPlayers.add(PaperServerListPingEvent.ListedPlayerInfo("§7No players online", UUID.randomUUID()))
60-
listedPlayers.add(PaperServerListPingEvent.ListedPlayerInfo("§6Be the first to join!", UUID.randomUUID()))
61-
listedPlayers.add(PaperServerListPingEvent.ListedPlayerInfo("§eStart a new challenge!", UUID.randomUUID()))
6257
}
6358
}
64-
}
59+
}

0 commit comments

Comments
 (0)