mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
require ranks to be displayed in login messgaes
This commit is contained in:
parent
503a8d5b4f
commit
5085b90727
@ -142,10 +142,15 @@ public class Command_myadmin extends FreedomCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
String msg = StringUtils.join(args, " ", 1, args.length);
|
String msg = StringUtils.join(args, " ", 1, args.length);
|
||||||
|
if (!msg.contains("%rank%") && !msg.contains("%coloredrank%"))
|
||||||
|
{
|
||||||
|
msg("Your login message must contain your rank. User either %rank% or %coloredrank% to specify where you want the rank", ChatColor.RED);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
FUtil.adminAction(sender.getName(), "Setting personal login message" + (init == null ? "" : " for " + targetPlayer.getName()), false);
|
FUtil.adminAction(sender.getName(), "Setting personal login message" + (init == null ? "" : " for " + targetPlayer.getName()), false);
|
||||||
target.setLoginMessage(msg);
|
target.setLoginMessage(msg);
|
||||||
msg((init == null ? "Your" : targetPlayer.getName() + "'s") + " login message is now: ");
|
msg((init == null ? "Your" : targetPlayer.getName() + "'s") + " login message is now: ");
|
||||||
msg("> " + ChatColor.AQUA + (msg.contains("%name%") ? "" : target.getName() + " is ") + FUtil.colorize(msg).replace("%name%", targetPlayer.getName()));
|
msg("> " + ChatColor.AQUA + (msg.contains("%name%") ? "" : target.getName() + " is ") + FUtil.colorize(msg).replace("%name%", targetPlayer.getName()).replace("%rank%", target.getRank().getName()).replace("%coloredrank%", target.getRank().getColoredName()));
|
||||||
plugin.al.save();
|
plugin.al.save();
|
||||||
plugin.al.updateTables();
|
plugin.al.updateTables();
|
||||||
return true;
|
return true;
|
||||||
|
@ -218,7 +218,7 @@ public class RankManager extends FreedomService
|
|||||||
Admin admin = plugin.al.getAdmin(player);
|
Admin admin = plugin.al.getAdmin(player);
|
||||||
if (admin.hasLoginMessage())
|
if (admin.hasLoginMessage())
|
||||||
{
|
{
|
||||||
loginMsg = ChatUtils.colorize(admin.getLoginMessage());
|
loginMsg = ChatUtils.colorize(admin.getLoginMessage()).replace("%rank%", admin.getRank().getName()).replace("%coloredrank%", admin.getRank().getColoredName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FUtil.bcastMsg(ChatColor.AQUA + (loginMsg.contains("%name%") ? "" : player.getName() + " is ") + FUtil.colorize(loginMsg).replace("%name%", player.getName()));
|
FUtil.bcastMsg(ChatColor.AQUA + (loginMsg.contains("%name%") ? "" : player.getName() + " is ") + FUtil.colorize(loginMsg).replace("%name%", player.getName()));
|
||||||
|
Loading…
Reference in New Issue
Block a user