From d0617ef3799fe7c91756c1e01a2710572ddb84ec Mon Sep 17 00:00:00 2001 From: Roman / Linnea Gräf Date: Sat, 26 Nov 2022 09:48:51 +0100 Subject: EnchantStyleCustomizer rewrite (#406) Co-authored-by: nea Co-authored-by: nea Co-authored-by: nea Co-authored-by: nea Co-authored-by: nea Co-authored-by: nea Co-authored-by: nea --- src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java index cac6990f..ecc03caf 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java @@ -301,7 +301,12 @@ public class Utils { } public static String chromaString(String str, float offset, boolean bold) { + return chromaString(str, offset, bold ? "§l" : ""); + } + + public static String chromaString(String str, float offset, String extraFormatting) { str = cleanColour(str); + boolean bold = extraFormatting.contains("§l"); long currentTimeMillis = System.currentTimeMillis(); if (startTime == 0) startTime = currentTimeMillis; @@ -320,7 +325,7 @@ public class Utils { if (index < 0) index += rainbow.length; rainbowText.append(rainbow[index]); - if (bold) rainbowText.append(EnumChatFormatting.BOLD); + rainbowText.append(extraFormatting); rainbowText.append(c); } return rainbowText.toString(); -- cgit