mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 06:28:54 +00:00
properly unify offline and vanish messages
This commit is contained in:
1 parent
3b765a758a
commit
305803199b
3 files changed
+12
-18
No files matched your search
+4
-6
@@ -43,12 +43,10 @@ public class ContinueCommand {
|
||||
.player(whisperTarget).join();
|
||||
final @MonotonicNonNull CarbonPlayer recipient = result.player();
|
||||
|
||||
if (recipient == null || !recipient.online()) {
|
||||
messageService.whisperTargetOffline(sender, CarbonPlayer.renderName(sender));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!sender.awareOf(recipient) && !sender.hasPermission("carbon.seevanish.continue")) {
|
||||
if (!recipient.online()
|
||||
|| (!sender.awareOf(recipient)
|
||||
&& !sender.hasPermission("carbon.seevanish.whisper"))
|
||||
) {
|
||||
final var rawNameInput = CloudUtils.rawInputByMatchingName(handler.getRawInput(), recipient);
|
||||
final var exception = new CarbonPlayerArgument.PlayerParseException(rawNameInput);
|
||||
|
||||
|
||||
@@ -45,12 +45,10 @@ public class ReplyCommand {
|
||||
final ComponentPlayerResult<CarbonPlayer> result = carbonChat.server().player(replyTarget).join();
|
||||
final @MonotonicNonNull CarbonPlayer recipient = result.player();
|
||||
|
||||
if (recipient == null || !recipient.online()) {
|
||||
messageService.replyTargetOffline(sender, CarbonPlayer.renderName(sender));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!sender.awareOf(recipient) && !sender.hasPermission("carbon.seevanish.reply")) {
|
||||
if (!recipient.online()
|
||||
|| (!sender.awareOf(recipient)
|
||||
&& !sender.hasPermission("carbon.seevanish.whisper"))
|
||||
) {
|
||||
final var rawNameInput = CloudUtils.rawInputByMatchingName(handler.getRawInput(), recipient);
|
||||
final var exception = new CarbonPlayerArgument.PlayerParseException(rawNameInput);
|
||||
|
||||
|
||||
@@ -35,12 +35,10 @@ public class WhisperCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!recipient.online()) {
|
||||
messageService.whisperTargetOffline(sender, CarbonPlayer.renderName(sender));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!sender.awareOf(recipient) && !sender.hasPermission("carbon.seevanish.whisper")) {
|
||||
if (!recipient.online()
|
||||
|| (!sender.awareOf(recipient)
|
||||
&& !sender.hasPermission("carbon.seevanish.whisper"))
|
||||
) {
|
||||
final var rawNameInput = CloudUtils.rawInputByMatchingName(handler.getRawInput(), recipient);
|
||||
final var exception = new CarbonPlayerArgument.PlayerParseException(rawNameInput);
|
||||
|
||||
|
||||
Reference in new issue
Block a user