This commit is contained in:
ZeroEpoch1969 2018-06-02 13:45:05 -07:00
parent c835d38b7c
commit b44d08eb55
No known key found for this signature in database
GPG Key ID: E0AAB104FB9F8FDF
2 changed files with 22 additions and 6 deletions

View File

@ -7,10 +7,7 @@ import me.totalfreedom.totalfreedommod.rank.Displayable;
import me.totalfreedom.totalfreedommod.util.FLog; import me.totalfreedom.totalfreedommod.util.FLog;
import me.totalfreedom.totalfreedommod.util.FSync; import me.totalfreedom.totalfreedommod.util.FSync;
import static me.totalfreedom.totalfreedommod.util.FUtil.playerMsg; import static me.totalfreedom.totalfreedommod.util.FUtil.playerMsg;
import me.totalfreedom.totalfreedommod.util.FUtil; import me.totalfreedom.totalfreedommod.util.FUtil;
import org.bukkit.Sound;
import org.bukkit.SoundCategory;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -109,6 +106,24 @@ public class ChatManager extends FreedomService
event.setFormat(format); event.setFormat(format);
} }
public ChatColor getColor(Admin admin, Displayable display)
{
ChatColor color = display.getColor();
if (admin.getOldTags())
{
if (color.equals(ChatColor.AQUA))
{
color = ChatColor.GOLD;
}
else if (color.equals(ChatColor.GOLD))
{
color = ChatColor.LIGHT_PURPLE;
}
}
return color;
}
public String getColoredTag(Admin admin, Displayable display) public String getColoredTag(Admin admin, Displayable display)
{ {
ChatColor color = display.getColor(); ChatColor color = display.getColor();
@ -140,7 +155,8 @@ public class ChatManager extends FreedomService
if (!Strings.isNullOrEmpty(admin.getAcFormat())) if (!Strings.isNullOrEmpty(admin.getAcFormat()))
{ {
String format = admin.getAcFormat(); String format = admin.getAcFormat();
String msg = format.replace("%name%", sender.getName()).replace("%rank%", display.getAbbr()).replace("%rankcolor%", display.getColor().toString()).replace("%msg%", message); ChatColor color = getColor(admin, display);
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

View File

@ -203,7 +203,7 @@ public class Command_myadmin extends FreedomCommand
target.setOldTags(!target.getOldTags()); target.setOldTags(!target.getOldTags());
plugin.al.save(); plugin.al.save();
plugin.al.updateTables(); plugin.al.updateTables();
msg(target.getOldTags() ? "Enabled" : "Disabled" + " old tags."); msg((target.getOldTags() ? "Enabled" : "Disabled") + " old tags.");
return true; return true;
} }