mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-30 02:05:41 +00:00
*sigh*
This commit is contained in:
parent
c835d38b7c
commit
b44d08eb55
@ -7,10 +7,7 @@ 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;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -109,10 +106,28 @@ public class ChatManager extends FreedomService
|
||||
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)
|
||||
{
|
||||
ChatColor color = display.getColor();
|
||||
if(admin.getOldTags())
|
||||
if (admin.getOldTags())
|
||||
{
|
||||
|
||||
if (color.equals(ChatColor.AQUA))
|
||||
@ -140,7 +155,8 @@ public class ChatManager extends FreedomService
|
||||
if (!Strings.isNullOrEmpty(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));
|
||||
}
|
||||
else
|
||||
|
@ -203,7 +203,7 @@ public class Command_myadmin extends FreedomCommand
|
||||
target.setOldTags(!target.getOldTags());
|
||||
plugin.al.save();
|
||||
plugin.al.updateTables();
|
||||
msg(target.getOldTags() ? "Enabled" : "Disabled" + " old tags.");
|
||||
msg((target.getOldTags() ? "Enabled" : "Disabled") + " old tags.");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user