File tree 2 files changed +8
-4
lines changed
project/runtime-bukkit/src/main
java/me/arasple/mc/trchat/util/color
kotlin/me/arasple/mc/trchat/util/color
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -126,8 +126,7 @@ public static String parseRainbow(String message) {
126
126
char c = chars [i ];
127
127
if (c == '&' && i + 1 < chars .length ) {
128
128
char next = chars [i + 1 ];
129
- org .bukkit .ChatColor color = org .bukkit .ChatColor .getByChar (next );
130
- if (color != null && color .isFormat ()) {
129
+ if (HexKt .isFormat (next )) {
131
130
compoundedFormat += String .valueOf (ChatColor .COLOR_CHAR ) + next ;
132
131
i ++; // Skip next character
133
132
continue ;
@@ -188,8 +187,7 @@ public static String parseGradients(String message) {
188
187
char c = chars [i ];
189
188
if (c == '&' && i + 1 < chars .length ) {
190
189
char next = chars [i + 1 ];
191
- org .bukkit .ChatColor color = org .bukkit .ChatColor .getByChar (next );
192
- if (color != null && color .isFormat ()) {
190
+ if (HexKt .isFormat (next )) {
193
191
compoundedFormat += String .valueOf (ChatColor .COLOR_CHAR ) + next ;
194
192
i ++; // Skip next character
195
193
continue ;
Original file line number Diff line number Diff line change 1
1
package me.arasple.mc.trchat.util.color
2
2
3
+ import org.bukkit.ChatColor
3
4
import taboolib.module.nms.MinecraftVersion
4
5
5
6
fun isHigherOrEqual11600 () = MinecraftVersion .isHigherOrEqual(MinecraftVersion .V1_16 )
6
7
8
+ fun isFormat (char : Char ): Boolean {
9
+ val color = ChatColor .getByChar(char)
10
+ return color != null && color.isFormat
11
+ }
12
+
7
13
fun String.colorify () = HexUtils .colorify(this )
8
14
9
15
fun String.parseLegacy () = HexUtils .parseLegacy(this )
You can’t perform that action at this time.
0 commit comments