mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 22:16:22 +00:00
don't throw an exception in ignore and unignore
This commit is contained in:
4 files changed
+8
-2
No files matched your search
@@ -61,7 +61,8 @@ public class IgnoreCommand {
|
||||
final var result = carbonChat.server().player(handler.<UUID>get("uuid")).join();
|
||||
target = Objects.requireNonNull(result.player(), "No player found for UUID.");
|
||||
} else {
|
||||
throw new IllegalStateException("No target found to unmute.");
|
||||
messageService.ignoreTargetInvalid(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
if (target.hasPermission("carbon.ignore.exempt")) {
|
||||
|
||||
+2
-1
@@ -61,7 +61,8 @@ public class UnignoreCommand {
|
||||
final var result = carbonChat.server().player(handler.<UUID>get("uuid")).join();
|
||||
target = Objects.requireNonNull(result.player(), "No player found for UUID.");
|
||||
} else {
|
||||
throw new IllegalStateException("No target found to unmute.");
|
||||
messageService.ignoreTargetInvalid(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
sender.ignoring(target, true);
|
||||
|
||||
@@ -299,6 +299,9 @@ public interface CarbonMessageService {
|
||||
@Message("ignore.no_longer_ignoring")
|
||||
void noLongerIgnoring(final Audience audience, final @Placeholder Component target);
|
||||
|
||||
@Message("ignore.invalid_target")
|
||||
void ignoreTargetInvalid(final Audience audience);
|
||||
|
||||
@Message("whisper.ignoring_target")
|
||||
void whisperIgnoringTarget(final Audience audience, final @Placeholder Component target);
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ command.help.click_for_previous_page=Click for previous page
|
||||
ignore.exempt=<red>You cannot ignore <target>
|
||||
ignore.now_ignoring=<green>You are now ignoring <target>
|
||||
ignore.no_longer_ignoring=<green>You are no longer ignoring <target>
|
||||
ignore.invalid_target=<red>No target found
|
||||
whisper.ignoring_target=<red>You are ignoring <target>
|
||||
whisper.ignored_by_target=<red><target> <red>is ignoring you
|
||||
config.reload.success=<green>Config reloaded successfully
|
||||
|
||||
Reference in new issue
Block a user