mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 14:38:49 +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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user