mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 14:38:49 +00:00
Finish custom color feature
This commit is contained in:
1 parent
77e74d05a3
commit
98d7501ee0
3 files changed
+34
-9
No files matched your search
@@ -16,6 +16,7 @@ import net.kyori.adventure.audience.Audience;
|
||||
import net.kyori.adventure.audience.ForwardingAudience;
|
||||
import net.kyori.adventure.identity.Identity;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.TextColor;
|
||||
import net.luckperms.api.LuckPerms;
|
||||
import net.luckperms.api.LuckPermsProvider;
|
||||
import net.luckperms.api.model.group.Group;
|
||||
@@ -46,6 +47,7 @@ public class BukkitPlayerUser implements PlayerUser, ForwardingAudience.Single {
|
||||
private boolean spyingWhispers = false;
|
||||
private @Nullable String nickname = null;
|
||||
private @Nullable UUID replyTarget = null;
|
||||
private @Nullable TextColor customChatColor = null;
|
||||
|
||||
private @Nullable String selectedChannelKey = null;
|
||||
private transient @Nullable ChatChannel selectedChannel = null;
|
||||
@@ -182,6 +184,27 @@ public class BukkitPlayerUser implements PlayerUser, ForwardingAudience.Single {
|
||||
return this.carbonChat.resolveName(this.uuid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable TextColor customChatColor() {
|
||||
return this.customChatColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void customChatColor(@Nullable final TextColor customChatColor, final boolean fromRemote) {
|
||||
this.customChatColor = customChatColor;
|
||||
|
||||
if (!fromRemote) {
|
||||
if (customChatColor == null) {
|
||||
this.carbonChat.messageManager().sendMessage("custom-chat-color-reset", this.uuid(), byteArray -> {
|
||||
});
|
||||
} else {
|
||||
this.carbonChat.messageManager().sendMessage("custom-chat-color", this.uuid(), byteArray -> {
|
||||
byteArray.writeUTF(customChatColor.asHexString());
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("argument.type.incompatible")
|
||||
public @Nullable ChatChannel selectedChannel() {
|
||||
|
||||
Reference in new issue
Block a user