Switch to Allman Formatting

This commit is contained in:
Paldiu 2021-03-21 14:02:43 -05:00
parent b03870c0aa
commit b3b68ebd13
2 changed files with 12 additions and 5 deletions

View File

@ -159,14 +159,17 @@ public class ChatManager extends FreedomService
FLog.info("[ADMIN] " + sender.getName() + " " + display.getTag() + ": " + message, true); FLog.info("[ADMIN] " + sender.getName() + " " + display.getTag() + ": " + message, true);
plugin.dc.messageAdminChatChannel(sender.getName() + " \u00BB " + message); plugin.dc.messageAdminChatChannel(sender.getName() + " \u00BB " + message);
server.getOnlinePlayers().stream().filter(player -> plugin.al.isAdmin(player)).forEach(player -> { server.getOnlinePlayers().stream().filter(player -> plugin.al.isAdmin(player)).forEach(player ->
{
Admin admin = plugin.al.getAdmin(player); Admin admin = plugin.al.getAdmin(player);
if (!Strings.isNullOrEmpty(admin.getAcFormat())) { if (!Strings.isNullOrEmpty(admin.getAcFormat())) {
String format = admin.getAcFormat(); String format = admin.getAcFormat();
ChatColor color = getColor(display); ChatColor color = getColor(display);
String msg = format.replace("%name%", sender.getName()).replace("%rank%", display.getAbbr()).replace("%rankcolor%", color.toString()).replace("%msg%", message); String msg = format.replace("%name%", sender.getName()).replace("%rank%", display.getAbbr()).replace("%rankcolor%", color.toString()).replace("%msg%", message);
player.sendMessage(FUtil.colorize(msg)); player.sendMessage(FUtil.colorize(msg));
} else { }
else
{
player.sendMessage("[" + ChatColor.AQUA + "ADMIN" + ChatColor.WHITE + "] " + ChatColor.DARK_RED + sender.getName() + ChatColor.DARK_GRAY + " [" + getColoredTag(display) + ChatColor.DARK_GRAY + "]" + ChatColor.WHITE + ": " + ChatColor.GOLD + FUtil.colorize(message)); player.sendMessage("[" + ChatColor.AQUA + "ADMIN" + ChatColor.WHITE + "] " + ChatColor.DARK_RED + sender.getName() + ChatColor.DARK_GRAY + " [" + getColoredTag(display) + ChatColor.DARK_GRAY + "]" + ChatColor.WHITE + ": " + ChatColor.GOLD + FUtil.colorize(message));
} }
}); });

View File

@ -56,10 +56,12 @@ public class DiscordToAdminChatListener extends ListenerAdapter
FLog.info(message.toString()); FLog.info(message.toString());
Bukkit.getOnlinePlayers().stream().filter(player -> TotalFreedomMod.getPlugin().al.isAdmin(player)).forEach(player -> { Bukkit.getOnlinePlayers().stream().filter(player -> TotalFreedomMod.getPlugin().al.isAdmin(player)).forEach(player ->
{
Admin admin = TotalFreedomMod.getPlugin().al.getAdmin(player); Admin admin = TotalFreedomMod.getPlugin().al.getAdmin(player);
String format = admin.getAcFormat(); String format = admin.getAcFormat();
if (!Strings.isNullOrEmpty(format)) { if (!Strings.isNullOrEmpty(format))
{
Displayable display = TotalFreedomMod.getPlugin().rm.getDisplay(player); Displayable display = TotalFreedomMod.getPlugin().rm.getDisplay(player);
net.md_5.bungee.api.ChatColor color = getColor(display); net.md_5.bungee.api.ChatColor color = getColor(display);
String m = format.replace("%name%", member.getEffectiveName()) String m = format.replace("%name%", member.getEffectiveName())
@ -67,7 +69,9 @@ public class DiscordToAdminChatListener extends ListenerAdapter
.replace("%rankcolor%", color.toString()) .replace("%rankcolor%", color.toString())
.replace("%msg%", FUtil.colorize(msg.getContentDisplay())); .replace("%msg%", FUtil.colorize(msg.getContentDisplay()));
builder.append(FUtil.colorize(m)); builder.append(FUtil.colorize(m));
} else { }
else
{
String m = ChatColor.DARK_RED + member.getEffectiveName() + " " String m = ChatColor.DARK_RED + member.getEffectiveName() + " "
+ ChatColor.DARK_GRAY + tag + ChatColor.DARK_GRAY + ChatColor.DARK_GRAY + tag + ChatColor.DARK_GRAY
+ ChatColor.WHITE + ": " + ChatColor.GOLD + FUtil.colorize(msg.getContentDisplay()); + ChatColor.WHITE + ": " + ChatColor.GOLD + FUtil.colorize(msg.getContentDisplay());