mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 14:38:49 +00:00
and it works
This commit is contained in:
1 parent
40fae513b2
commit
662d327400
6 files changed
+30
-7
No files matched your search
@@ -265,6 +265,11 @@ public final class CarbonPlayerBukkit extends CarbonPlayerCommon implements Forw
|
||||
return this.player() != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void whisperReplyTarget(@Nullable UUID uuid) {
|
||||
this.carbonPlayer.whisperReplyTarget(uuid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable UUID whisperReplyTarget() {
|
||||
return this.carbonPlayer.whisperReplyTarget();
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
}
|
||||
@@ -6,3 +6,6 @@ unsupported.legacy=<red>Legacy color codes have been detected in a message. This
|
||||
channel.change=<green>You are now messaging </green><channel><green> chat!</green>
|
||||
whisper.to=<gold>[<green>You</green>] -> [<green><recipientDisplayName></green>] <message>
|
||||
whisper.from=<gold>[<green><senderDisplayName></green>] -> [<green>You</green>] <message>
|
||||
reply.target.missing=<red>You have no-one to reply to.
|
||||
reply.target.offline=<red>That person is offline.
|
||||
reply.target.self=<red>You cannot whisper to yourself.
|
||||
Reference in new issue
Block a user