mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +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.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
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user