Skip to content

Commit

Permalink
Fix multiple hex chat colors. Fixes Blackixx/BossShopPro#114
Browse files Browse the repository at this point in the history
  • Loading branch information
Travja committed Dec 31, 2022
1 parent d9da48e commit 54d9e4d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,8 @@ public String transform(String s) {

private String colorize(String string) {
if (VersionManager.isAtLeast(16)) {
Pattern pattern = Pattern.compile("#[a-fA-F0-9]{6}");
for (Matcher matcher = pattern.matcher(string); matcher.find(); matcher = pattern.matcher(string)) {
String color = string.substring(matcher.start(), matcher.end());
for (Matcher matcher = hexPattern.matcher(string); matcher.find(); matcher = hexPattern.matcher(string)) {
String color = matcher.group(1);
string = string.replace(color, net.md_5.bungee.api.ChatColor.of(color) + "");
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ api-version: 1.13
description: The BOSS Shop Plugin *PRO VERSION*
author: Black_ixx, ProMCTeam
main: org.black_ixx.bossshop.BossShop
softdepend: [ProRPGItems, ItemsAdder ,MagicCosmetics, MythicMobs, PlayerShops GUI, ItemShops, ThirdCurrency, GuiShopManager, LimitedUses, TrickyShops, Vault, PlayerPoints, Jobs, Gringotts, VotingPlugin, SilkSpawners, PlaceholderAPI]
softdepend: [ProRPGItems, ItemsAdder, MagicCosmetics, MythicMobs, PlayerShops GUI, ItemShops, ThirdCurrency, GuiShopManager, LimitedUses, TrickyShops, Vault, PlayerPoints, Jobs, Gringotts, VotingPlugin, SilkSpawners, PlaceholderAPI]
#libraries: [ org.apache.commons:commons-lang3:3.12.0 ]
commands:
bs:
Expand Down

0 comments on commit 54d9e4d

Please sign in to comment.