Skip to content

Commit c11bf1e

Browse files
Fix coloring issue for item name using escape character again
1 parent 9d4c807 commit c11bf1e

File tree

1 file changed

+3
-2
lines changed
  • src/main/java/org/maxgamer/quickshop/util

1 file changed

+3
-2
lines changed

src/main/java/org/maxgamer/quickshop/util/Util.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,9 @@ public static String getItemCustomName(@NotNull ItemStack itemStack) {
567567
if (displayName == null || displayName.isEmpty()) {
568568
return null;
569569
} else {
570+
//Some item name using escape character, causing rgb color could not decode correctly
571+
//So fix it there
572+
displayName = displayName.replace("&&x", "&x").replace("§§x", "§x");
570573
return displayName;
571574
}
572575
}
@@ -1195,8 +1198,6 @@ public static String parseColours(@Nullable String text) {
11951198
MineDownParser parser = MINEDOWN.get().parser();
11961199
parser.reset();
11971200

1198-
//Fix some item name using escape character, causing rgb color could not decode correctly
1199-
text = text.replace("&&x", "&x").replace("§§x", "§x");
12001201
//A hack for saving reset character
12011202
text = text.replace("&r", "&l&r").replace("§r", "§l§r");
12021203
return toLegacyText(parser.enable(MineDownParser.Option.LEGACY_COLORS).enable(MineDownParser.Option.APPEND_COLORS_TO_EMPTY_STRING).backwardsCompatibility(true).parse(text).create());

0 commit comments

Comments
 (0)