and it works

This commit is contained in:
Draycia committed 2021-09-19 21:24:33 -07:00
1 parent 40fae513b2
commit 662d327400
6 files changed
+30 -7

No files matched your search

@@ -2,9 +2,6 @@ package net.draycia.carbon.common;
import com.google.inject.Injector;
import net.draycia.carbon.api.CarbonChat;
import net.draycia.carbon.common.command.commands.WhisperCommand;
import net.draycia.carbon.common.listeners.DeafenHandler;
import net.draycia.carbon.common.listeners.MuteHandler;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.framework.qual.DefaultQualifier;
@@ -32,7 +32,7 @@ public class ReplyCommand {
final UUID replyTarget = sender.whisperReplyTarget();
if (replyTarget == null) {
// TODO: send error message "no reply target"
messageService.replyTargetNotSet(sender, sender.displayName());
return;
}
@@ -40,12 +40,12 @@ public class ReplyCommand {
final @MonotonicNonNull CarbonPlayer recipient = result.player();
if (recipient == null) {
// TODO: send error message "reply target not online"
messageService.replyTargetOffline(sender, sender.displayName());
return;
}
if (sender.equals(recipient)) {
// TODO: send error message "you cannot whisper yourself!"
messageService.whisperSelfError(sender, sender.displayName());
return;
}
@@ -30,7 +30,7 @@ public class WhisperCommand {
final CarbonPlayer recipient = handler.get("recipient");
if (sender.equals(recipient)) {
// TODO: send error message "you cannot whisper yourself!"
messageService.whisperSelfError(sender, sender.displayName());
return;
}
@@ -58,4 +58,22 @@ public interface CarbonMessageService {
@Placeholder String message
);
@Message("reply.target.missing")
void replyTargetNotSet(
final Audience audience,
@Placeholder Component senderDisplayName
);
@Message("reply.target.offline")
void replyTargetOffline(
final Audience audience,
@Placeholder Component senderDisplayName
);
@Message("reply.target.self")
void whisperSelfError(
final Audience audience,
@Placeholder Component senderDisplayName
);
}