refactor: don't use .color(TextColor) when we can Component.text(something, color) or Component.translatable(something, color, ...args)

This commit is contained in:
ChomeNS
2025-06-03 16:15:54 +07:00
parent 78f84f1c71
commit bcaf59c19d
31 changed files with 188 additions and 170 deletions

View File

@@ -44,7 +44,7 @@ public class NetMessageCommand extends Command {
.hoverEvent(
HoverEvent.showText(
Component.empty()
.append(Component.text(originServerAddress).color(NamedTextColor.GRAY))
.append(Component.text(originServerAddress, NamedTextColor.GRAY))
.append(Component.newline())
.append(Component.translatable("commands.netmsg.hover.copy_server_to_clipboard", NamedTextColor.GREEN))
)
@@ -60,7 +60,7 @@ public class NetMessageCommand extends Command {
serverNameComponent,
Component.space(),
context.sender.displayName == null ?
Component.text(context.sender.profile.getName()).color(NamedTextColor.GRAY) :
Component.text(context.sender.profile.getName(), NamedTextColor.GRAY) :
context.sender.displayName.color(NamedTextColor.GRAY),
Component.space(),
Component.empty()