mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-04 06:28:53 +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();
|
.player(whisperTarget).join();
|
||||||
final @MonotonicNonNull CarbonPlayer recipient = result.player();
|
final @MonotonicNonNull CarbonPlayer recipient = result.player();
|
||||||
|
|
||||||
if (recipient == null || !recipient.online()) {
|
if (!recipient.online()
|
||||||
messageService.whisperTargetOffline(sender, CarbonPlayer.renderName(sender));
|
|| (!sender.awareOf(recipient)
|
||||||
return;
|
&& !sender.hasPermission("carbon.seevanish.whisper"))
|
||||||
}
|
) {
|
||||||
|
|
||||||
if (!sender.awareOf(recipient) && !sender.hasPermission("carbon.seevanish.continue")) {
|
|
||||||
final var rawNameInput = CloudUtils.rawInputByMatchingName(handler.getRawInput(), recipient);
|
final var rawNameInput = CloudUtils.rawInputByMatchingName(handler.getRawInput(), recipient);
|
||||||
final var exception = new CarbonPlayerArgument.PlayerParseException(rawNameInput);
|
final var exception = new CarbonPlayerArgument.PlayerParseException(rawNameInput);
|
||||||
|
|
||||||
|
|||||||
@@ -45,12 +45,10 @@ public class ReplyCommand {
|
|||||||
final ComponentPlayerResult<CarbonPlayer> result = carbonChat.server().player(replyTarget).join();
|
final ComponentPlayerResult<CarbonPlayer> result = carbonChat.server().player(replyTarget).join();
|
||||||
final @MonotonicNonNull CarbonPlayer recipient = result.player();
|
final @MonotonicNonNull CarbonPlayer recipient = result.player();
|
||||||
|
|
||||||
if (recipient == null || !recipient.online()) {
|
if (!recipient.online()
|
||||||
messageService.replyTargetOffline(sender, CarbonPlayer.renderName(sender));
|
|| (!sender.awareOf(recipient)
|
||||||
return;
|
&& !sender.hasPermission("carbon.seevanish.whisper"))
|
||||||
}
|
) {
|
||||||
|
|
||||||
if (!sender.awareOf(recipient) && !sender.hasPermission("carbon.seevanish.reply")) {
|
|
||||||
final var rawNameInput = CloudUtils.rawInputByMatchingName(handler.getRawInput(), recipient);
|
final var rawNameInput = CloudUtils.rawInputByMatchingName(handler.getRawInput(), recipient);
|
||||||
final var exception = new CarbonPlayerArgument.PlayerParseException(rawNameInput);
|
final var exception = new CarbonPlayerArgument.PlayerParseException(rawNameInput);
|
||||||
|
|
||||||
|
|||||||
@@ -35,12 +35,10 @@ public class WhisperCommand {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!recipient.online()) {
|
if (!recipient.online()
|
||||||
messageService.whisperTargetOffline(sender, CarbonPlayer.renderName(sender));
|
|| (!sender.awareOf(recipient)
|
||||||
return;
|
&& !sender.hasPermission("carbon.seevanish.whisper"))
|
||||||
}
|
) {
|
||||||
|
|
||||||
if (!sender.awareOf(recipient) && !sender.hasPermission("carbon.seevanish.whisper")) {
|
|
||||||
final var rawNameInput = CloudUtils.rawInputByMatchingName(handler.getRawInput(), recipient);
|
final var rawNameInput = CloudUtils.rawInputByMatchingName(handler.getRawInput(), recipient);
|
||||||
final var exception = new CarbonPlayerArgument.PlayerParseException(rawNameInput);
|
final var exception = new CarbonPlayerArgument.PlayerParseException(rawNameInput);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user