Skip to content

Commit aa6fd92

Browse files
committed
Fix ChatUtil color formatting
1 parent 0fb5128 commit aa6fd92

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Common/src/main/java/mezz/jei/common/util/ChatUtil.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import net.minecraft.ChatFormatting;
44
import net.minecraft.network.chat.Component;
5+
import net.minecraft.network.chat.MutableComponent;
6+
import net.minecraft.network.chat.Style;
57
import net.minecraft.world.entity.player.Player;
68

79
/**
@@ -12,8 +14,9 @@ private ChatUtil() {
1214
}
1315

1416
public static void writeChatMessage(Player player, String translationKey, ChatFormatting color) {
15-
Component component = Component.translatable(translationKey);
16-
component.getStyle().applyFormat(color);
17+
MutableComponent component = Component.translatable(translationKey);
18+
Style redStyle = component.getStyle().applyFormat(color);
19+
component.setStyle(redStyle);
1720
player.displayClientMessage(component, false);
1821
}
1922
}

0 commit comments

Comments
 (0)