File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
src/main/kotlin/com/mairwunnx/projectessentials/chat/commands Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ object MutedPlayersCommand {
2323 private val locMessageReason = TranslationTextComponent (
2424 " project_essentials_chat.chat.out_reason"
2525 ).formattedText
26+ private val locMessageNone = TranslationTextComponent (
27+ " project_essentials_chat.chat.out_muted_players_none"
28+ ).formattedText
2629
2730 fun register (dispatcher : CommandDispatcher <CommandSource >) {
2831 logger.info(" Register \" /muted-players\" command" )
@@ -48,13 +51,17 @@ object MutedPlayersCommand {
4851 val mutedPlayers = MuteAPI .getMutedPlayers()
4952 val message = buildString {
5053 this .append(" §7$locMessageMutedPlayer :\n " )
51- mutedPlayers.forEach {
52- val mutedBy = MuteAPI .getMuteInitiator(it)!!
53- val reason = MuteAPI .getMuteReason(it)!!
54+ if (mutedPlayers.isNotEmpty()) {
55+ mutedPlayers.forEach {
56+ val mutedBy = MuteAPI .getMuteInitiator(it)!!
57+ val reason = MuteAPI .getMuteReason(it)!!
5458
55- this .append(
56- " §7- §c$it §7, $locMessageMutedBy §c$mutedBy §7, $locMessageReason : §c$reason "
57- )
59+ this .append(
60+ " §7 - §c$it §7, $locMessageMutedBy §c$mutedBy §7, $locMessageReason : §c$reason "
61+ )
62+ }
63+ } else {
64+ this .append(" §c$locMessageNone " )
5865 }
5966 }
6067
You can’t perform that action at this time.
0 commit comments