Skip to content

Commit

Permalink
feat: require permission to receive mute alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
Draycia committed Jan 24, 2025
1 parent c95ed95 commit 9c043f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ public void init() {
continue;
}

this.carbonMessages.muteAlertPlayers(player, target.displayName());
if (player.hasPermission("carbon.mute.alert")) {
this.carbonMessages.muteAlertPlayers(player, target.displayName());
}
}

target.muted(true);
Expand Down Expand Up @@ -160,7 +162,9 @@ private void handleTempMute(final Duration duration, final CarbonPlayer target)
continue;
}

this.carbonMessages.tempMuteAlertPlayers(player, target.displayName(), formattedDuration);
if (player.hasPermission("carbon.mute.alert")) {
this.carbonMessages.tempMuteAlertPlayers(player, target.displayName(), formattedDuration);
}
}

target.muted(true);
Expand Down
2 changes: 1 addition & 1 deletion common/src/main/resources/locale/messages-en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ ignore.invalid_target=<red>No target found
ignore.now_ignoring=<green>You are now ignoring <target>
ignore.no_longer_ignoring=<green>You are no longer ignoring <target>
mute.alert.players=<red><target> <red>has been muted
mute.alert.players.temp=<red>You have been muted for <duration>
mute.alert.players.temp=<red><target> <red>has been muted for <duration>
mute.alert.target=<red>You have been muted
mute.alert.target.temp=<red>You have been muted for <duration>
mute.cannot_speak=<red>You cannot speak when muted
Expand Down

0 comments on commit 9c043f5

Please sign in to comment.