aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java
diff options
context:
space:
mode:
authorRoman / Linnea Gräf <roman.graef@gmail.com>2022-11-26 09:48:51 +0100
committerGitHub <noreply@github.com>2022-11-26 19:48:51 +1100
commitd0617ef3799fe7c91756c1e01a2710572ddb84ec (patch)
tree075bcfa04c5e42b1bd47ea93b95f72fb74d42618 /src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java
parent7db5251c1cf9558b6d310b39a596d94850738c82 (diff)
downloadnotenoughupdates-d0617ef3799fe7c91756c1e01a2710572ddb84ec.tar.gz
notenoughupdates-d0617ef3799fe7c91756c1e01a2710572ddb84ec.tar.bz2
notenoughupdates-d0617ef3799fe7c91756c1e01a2710572ddb84ec.zip
EnchantStyleCustomizer rewrite (#406)
Co-authored-by: nea <romangraef@gmail.com> Co-authored-by: nea <roman.graef@gmail.com> Co-authored-by: nea <nea@nea.moe> Co-authored-by: nea <romangraef@loves.dicksinhisan.us> Co-authored-by: nea <roman.graef@grb-online.net> Co-authored-by: nea <hello@nea89.moe> Co-authored-by: nea <roman.graef@stud.tu-darmstadt.de>
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java7
1 files changed, 6 insertions, 1 deletions
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();