mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 14:38:51 +00:00
Add whisper message logs
This commit is contained in:
5 files changed
+28
-13
No files matched your search
+5
-4
@@ -97,11 +97,12 @@ public class ContinueCommand {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
messageService.whisperSender(new SourcedAudience(sender, sender),
|
final Component senderName = CarbonPlayer.renderName(sender);
|
||||||
CarbonPlayer.renderName(sender), CarbonPlayer.renderName(recipient), message);
|
final Component recipientName = CarbonPlayer.renderName(recipient);
|
||||||
|
|
||||||
messageService.whisperRecipient(new SourcedAudience(sender, recipient),
|
messageService.whisperSender(new SourcedAudience(sender, sender), senderName, recipientName, message);
|
||||||
CarbonPlayer.renderName(sender), CarbonPlayer.renderName(recipient), message);
|
messageService.whisperRecipient(new SourcedAudience(sender, recipient), senderName, recipientName, message);
|
||||||
|
messageService.whisperConsoleLog(carbonChat.server().console(), senderName, recipientName, message);
|
||||||
|
|
||||||
sender.lastWhisperTarget(recipient.uuid());
|
sender.lastWhisperTarget(recipient.uuid());
|
||||||
sender.whisperReplyTarget(recipient.uuid());
|
sender.whisperReplyTarget(recipient.uuid());
|
||||||
|
|||||||
@@ -99,11 +99,12 @@ public class ReplyCommand {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
messageService.whisperSender(new SourcedAudience(sender, sender),
|
final Component senderName = CarbonPlayer.renderName(sender);
|
||||||
CarbonPlayer.renderName(sender), CarbonPlayer.renderName(recipient), message);
|
final Component recipientName = CarbonPlayer.renderName(recipient);
|
||||||
|
|
||||||
messageService.whisperRecipient(new SourcedAudience(sender, recipient),
|
messageService.whisperSender(new SourcedAudience(sender, sender), senderName, recipientName, message);
|
||||||
CarbonPlayer.renderName(sender), CarbonPlayer.renderName(recipient), message);
|
messageService.whisperRecipient(new SourcedAudience(sender, recipient), senderName, recipientName, message);
|
||||||
|
messageService.whisperConsoleLog(carbonChat.server().console(), senderName, recipientName, message);
|
||||||
|
|
||||||
sender.lastWhisperTarget(recipient.uuid());
|
sender.lastWhisperTarget(recipient.uuid());
|
||||||
sender.whisperReplyTarget(recipient.uuid());
|
sender.whisperReplyTarget(recipient.uuid());
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ package net.draycia.carbon.common.command.commands;
|
|||||||
import cloud.commandframework.CommandManager;
|
import cloud.commandframework.CommandManager;
|
||||||
import cloud.commandframework.arguments.standard.StringArgument;
|
import cloud.commandframework.arguments.standard.StringArgument;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
import net.draycia.carbon.api.CarbonServer;
|
||||||
import net.draycia.carbon.api.users.CarbonPlayer;
|
import net.draycia.carbon.api.users.CarbonPlayer;
|
||||||
import net.draycia.carbon.api.util.SourcedAudience;
|
import net.draycia.carbon.api.util.SourcedAudience;
|
||||||
import net.draycia.carbon.common.command.Commander;
|
import net.draycia.carbon.common.command.Commander;
|
||||||
@@ -29,6 +30,7 @@ import net.draycia.carbon.common.command.PlayerCommander;
|
|||||||
import net.draycia.carbon.common.command.argument.CarbonPlayerArgument;
|
import net.draycia.carbon.common.command.argument.CarbonPlayerArgument;
|
||||||
import net.draycia.carbon.common.messages.CarbonMessageService;
|
import net.draycia.carbon.common.messages.CarbonMessageService;
|
||||||
import net.draycia.carbon.common.util.CloudUtils;
|
import net.draycia.carbon.common.util.CloudUtils;
|
||||||
|
import net.kyori.adventure.text.Component;
|
||||||
|
|
||||||
public class WhisperCommand {
|
public class WhisperCommand {
|
||||||
|
|
||||||
@@ -36,7 +38,8 @@ public class WhisperCommand {
|
|||||||
public WhisperCommand(
|
public WhisperCommand(
|
||||||
final CommandManager<Commander> commandManager,
|
final CommandManager<Commander> commandManager,
|
||||||
final CarbonMessageService messageService,
|
final CarbonMessageService messageService,
|
||||||
final CarbonPlayerArgument carbonPlayerArgument
|
final CarbonPlayerArgument carbonPlayerArgument,
|
||||||
|
final CarbonServer carbonServer
|
||||||
) {
|
) {
|
||||||
final var command = commandManager.commandBuilder("whisper", "w", "message", "msg")
|
final var command = commandManager.commandBuilder("whisper", "w", "message", "msg")
|
||||||
.argument(carbonPlayerArgument.newInstance(true, "recipient", CarbonPlayerArgument.NO_SENDER))
|
.argument(carbonPlayerArgument.newInstance(true, "recipient", CarbonPlayerArgument.NO_SENDER))
|
||||||
@@ -80,11 +83,12 @@ public class WhisperCommand {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
messageService.whisperSender(new SourcedAudience(sender, sender),
|
final Component senderName = CarbonPlayer.renderName(sender);
|
||||||
CarbonPlayer.renderName(sender), CarbonPlayer.renderName(recipient), message);
|
final Component recipientName = CarbonPlayer.renderName(recipient);
|
||||||
|
|
||||||
messageService.whisperRecipient(new SourcedAudience(sender, recipient),
|
messageService.whisperSender(new SourcedAudience(sender, sender), senderName, recipientName, message);
|
||||||
CarbonPlayer.renderName(sender), CarbonPlayer.renderName(recipient), message);
|
messageService.whisperRecipient(new SourcedAudience(sender, recipient), senderName, recipientName, message);
|
||||||
|
messageService.whisperConsoleLog(carbonServer.console(), senderName, recipientName, message);
|
||||||
|
|
||||||
sender.lastWhisperTarget(recipient.uuid());
|
sender.lastWhisperTarget(recipient.uuid());
|
||||||
sender.whisperReplyTarget(recipient.uuid());
|
sender.whisperReplyTarget(recipient.uuid());
|
||||||
|
|||||||
@@ -119,6 +119,14 @@ public interface CarbonMessageService {
|
|||||||
final String message
|
final String message
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@Message("whisper.console")
|
||||||
|
void whisperConsoleLog(
|
||||||
|
final Audience audience,
|
||||||
|
@Placeholder("sender_display_name") final Component senderDisplayName,
|
||||||
|
@Placeholder("recipient_display_name") final Component recipientDisplayName,
|
||||||
|
final String message
|
||||||
|
);
|
||||||
|
|
||||||
@Message("reply.target.missing")
|
@Message("reply.target.missing")
|
||||||
void replyTargetNotSet(final Audience audience, @Placeholder("sender_display_name") final Component senderDisplayName);
|
void replyTargetNotSet(final Audience audience, @Placeholder("sender_display_name") final Component senderDisplayName);
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ nickname.show.unset=<red>You do not have a nickname set
|
|||||||
nickname.show=<green>Your nickname is </green><nickname>
|
nickname.show=<green>Your nickname is </green><nickname>
|
||||||
reply.target.missing=<red>You have no-one to reply to
|
reply.target.missing=<red>You have no-one to reply to
|
||||||
reply.target.self=<red>You cannot whisper to yourself
|
reply.target.self=<red>You cannot whisper to yourself
|
||||||
|
whisper.console=<gold>[<green><sender_display_name></green>] -> [<green><recipient_display_name></green>] <message>
|
||||||
whisper.continue.target_missing=<red>You have no one to whisper
|
whisper.continue.target_missing=<red>You have no one to whisper
|
||||||
whisper.from=<gold>[<green><sender_display_name></green>] -> [<green>You</green>] <message>
|
whisper.from=<gold>[<green><sender_display_name></green>] -> [<green>You</green>] <message>
|
||||||
whisper.ignored_by_target=<red><target> <red>is ignoring you
|
whisper.ignored_by_target=<red><target> <red>is ignoring you
|
||||||
|
|||||||
Reference in new issue
Block a user