Add color code support for Discord bridge

This commit is contained in:
business-goose 2022-03-21 09:26:24 +00:00
parent cb7f603928
commit 5c2e785669

View file

@ -7,6 +7,7 @@ import me.StevenLawson.TotalFreedomMod.config.MainConfig;
import me.StevenLawson.TotalFreedomMod.player.PlayerList; import me.StevenLawson.TotalFreedomMod.player.PlayerList;
import me.StevenLawson.TotalFreedomMod.player.PlayerRank; import me.StevenLawson.TotalFreedomMod.player.PlayerRank;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.javacord.api.DiscordApi; import org.javacord.api.DiscordApi;
import org.javacord.api.DiscordApiBuilder; import org.javacord.api.DiscordApiBuilder;
@ -84,7 +85,7 @@ public class DiscordBridge {
format = format.replace("{TAG}", author.getDiscriminatedName()); format = format.replace("{TAG}", author.getDiscriminatedName());
format = format.replace("{USERNAME}", author.getName()); format = format.replace("{USERNAME}", author.getName());
Bukkit.broadcastMessage(String.format(format, content)); Bukkit.broadcastMessage(ChatColor.translateAlternateColorCodes('&', String.format(format, content)));
} }
}); });
} catch (Exception e) { } catch (Exception e) {