attempting to make good codes at 3 in the morning isnt very bright

This commit is contained in:
ZeroEpoch1969 2018-06-02 13:08:35 -07:00
parent 7026423e8e
commit c835d38b7c
No known key found for this signature in database
GPG key ID: E0AAB104FB9F8FDF
2 changed files with 5 additions and 4 deletions

View file

@ -7,6 +7,8 @@ import me.totalfreedom.totalfreedommod.rank.Displayable;
import me.totalfreedom.totalfreedommod.util.FLog;
import me.totalfreedom.totalfreedommod.util.FSync;
import static me.totalfreedom.totalfreedommod.util.FUtil.playerMsg;
import me.totalfreedom.totalfreedommod.util.FUtil;
import org.bukkit.Sound;
import org.bukkit.SoundCategory;
import org.bukkit.ChatColor;
@ -137,10 +139,9 @@ public class ChatManager extends FreedomService
Admin admin = plugin.al.getAdmin(player);
if (!Strings.isNullOrEmpty(admin.getAcFormat()))
{
String coloredTag = getColoredTag(admin, display);
String format = admin.getAcFormat();
String msg = format.replace("%name%", sender.getName()).replace("%tag%", coloredTag).replace("%message%", message);
player.sendMessage(msg);
String msg = format.replace("%name%", sender.getName()).replace("%rank%", display.getAbbr()).replace("%rankcolor%", display.getColor().toString()).replace("%msg%", message);
player.sendMessage(FUtil.colorize(msg));
}
else
{

View file

@ -186,7 +186,7 @@ public class Command_myadmin extends FreedomCommand
plugin.al.save();
plugin.al.updateTables();
msg("Set admin chat format to \"" + format + "\".", ChatColor.GRAY);
String example = format.replace("%name%", "ExampleAdmin").replace("%rank%", "STA").replace("%msg%", "The quick brown fox jumps over the lazy dog.");
String example = format.replace("%name%", "ExampleAdmin").replace("%rank%", Rank.TELNET_ADMIN.getAbbr()).replace("%rankcolor%", Rank.TELNET_ADMIN.getColor().toString()).replace("%msg%", "The quick brown fox jumps over the lazy dog.");
msg(ChatColor.GRAY + "Example: " + FUtil.colorize(example));
return true;
}