Skip to content

Commit 91c6b61

Browse files
committed
try to utilize new key methods
1 parent b7dfc9b commit 91c6b61

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/main/java/gregtech/api/util/KeyUtil.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ public class KeyUtil {
1515
public static IKey colored(TextFormatting formatting, IKey... keys) {
1616
if (ArrayUtils.isEmpty(keys)) return wrap(formatting);
1717
if (keys.length == 1) return IKey.comp(wrap(formatting), keys[0]);
18-
return IKey.comp(wrap(formatting), IKey.comp(keys));
18+
return IKey.comp(keys).format(formatting);
1919
}
2020

2121
public static IKey string(String s) {
22-
return string(TextFormatting.RESET, s);
22+
return IKey.str(s);
2323
}
2424

2525
public static IKey string(Supplier<String> s) {
@@ -28,11 +28,11 @@ public static IKey string(Supplier<String> s) {
2828

2929
public static IKey string(TextFormatting formatting, String string) {
3030
if (string == null) return IKey.EMPTY;
31-
return IKey.comp(wrap(formatting), IKey.str(string));
31+
return IKey.str(string).format(formatting);
3232
}
3333

3434
public static IKey string(TextFormatting formatting, Supplier<String> stringSupplier) {
35-
return IKey.dynamic(() -> formatting + stringSupplier.get());
35+
return IKey.dynamic(stringSupplier).format(formatting);
3636
}
3737

3838
public static IKey string(Supplier<TextFormatting> formatting, String s) {
@@ -48,8 +48,7 @@ public static IKey lang(String lang, Object... args) {
4848
}
4949

5050
public static IKey lang(TextFormatting formatting, String lang, Object... args) {
51-
if (ArrayUtils.isEmpty(args)) return colored(formatting, IKey.lang(lang));
52-
return colored(formatting, IKey.lang(lang, checkFormatting(formatting, args)));
51+
return IKey.lang(lang, args).format(formatting);
5352
}
5453

5554
public static IKey lang(TextFormatting formatting, String lang, Supplier<?>... argSuppliers) {

0 commit comments

Comments
 (0)