mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 14:38:51 +00:00
I'll be surprised if this method ever returns null again
This commit is contained in:
1 parent
f75d2af11a
commit
64f5598bf8
1 file changed
+13
-2
@@ -8,6 +8,7 @@ import net.draycia.carbon.events.ChatFormatEvent;
|
|||||||
import net.draycia.carbon.events.PreChatFormatEvent;
|
import net.draycia.carbon.events.PreChatFormatEvent;
|
||||||
import net.draycia.carbon.storage.ChatUser;
|
import net.draycia.carbon.storage.ChatUser;
|
||||||
import net.kyori.adventure.text.TextComponent;
|
import net.kyori.adventure.text.TextComponent;
|
||||||
|
import net.kyori.adventure.text.format.NamedTextColor;
|
||||||
import net.kyori.adventure.text.format.TextColor;
|
import net.kyori.adventure.text.format.TextColor;
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||||
@@ -339,10 +340,20 @@ public class CarbonChatChannel extends ChatChannel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (user.isOnline()) {
|
if (user.isOnline()) {
|
||||||
return TextColor.fromHexString(PlaceholderAPI.setPlaceholders(user.asPlayer(), color));
|
TextColor textColor = TextColor.fromHexString(PlaceholderAPI.setPlaceholders(user.asPlayer(), color));
|
||||||
|
|
||||||
|
if (textColor != null) {
|
||||||
|
return textColor;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TextColor.fromHexString(color);
|
TextColor textColor = TextColor.fromHexString(color);
|
||||||
|
|
||||||
|
if (textColor != null) {
|
||||||
|
return textColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NamedTextColor.WHITE;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getDefaultFormatName() {
|
private String getDefaultFormatName() {
|
||||||
|
|||||||
Reference in new issue
Block a user