mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-16 12:26:12 +00:00
fix titles not showing up in login messages
This commit is contained in:
parent
fb336f27bb
commit
841e354d35
@ -150,7 +150,7 @@ public class Command_myadmin extends FreedomCommand
|
||||
FUtil.adminAction(sender.getName(), "Setting personal login message" + (init == null ? "" : " for " + targetPlayer.getName()), false);
|
||||
target.setLoginMessage(msg);
|
||||
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()).replace("%rank%", target.getRank().getName()).replace("%coloredrank%", target.getRank().getColoredName()));
|
||||
msg("> " + ChatColor.AQUA + (msg.contains("%name%") ? "" : target.getName() + " is ") + FUtil.colorize(msg).replace("%name%", targetPlayer.getName()).replace("%rank%", plugin.rm.getDisplay(target).getName()).replace("%coloredrank%", plugin.rm.getDisplay(target).getColoredName()));
|
||||
plugin.al.save();
|
||||
plugin.al.updateTables();
|
||||
return true;
|
||||
|
@ -81,6 +81,28 @@ public class RankManager extends FreedomService
|
||||
return getRank(player);
|
||||
}
|
||||
|
||||
public Displayable getDisplay(Admin admin)
|
||||
{
|
||||
// If the player's an owner, display that
|
||||
if (ConfigEntry.SERVER_OWNERS.getList().contains(admin.getName()))
|
||||
{
|
||||
return Title.OWNER;
|
||||
}
|
||||
|
||||
// Developers always show up
|
||||
if (FUtil.DEVELOPERS.contains(admin.getName()))
|
||||
{
|
||||
return Title.DEVELOPER;
|
||||
}
|
||||
|
||||
if (ConfigEntry.SERVER_EXECUTIVES.getList().contains(admin.getName()))
|
||||
{
|
||||
return Title.EXECUTIVE;
|
||||
}
|
||||
|
||||
return admin.getRank();
|
||||
}
|
||||
|
||||
public Rank getRank(CommandSender sender)
|
||||
{
|
||||
if (sender instanceof Player)
|
||||
@ -218,7 +240,7 @@ public class RankManager extends FreedomService
|
||||
Admin admin = plugin.al.getAdmin(player);
|
||||
if (admin.hasLoginMessage())
|
||||
{
|
||||
loginMsg = ChatUtils.colorize(admin.getLoginMessage()).replace("%rank%", admin.getRank().getName()).replace("%coloredrank%", admin.getRank().getColoredName());
|
||||
loginMsg = ChatUtils.colorize(admin.getLoginMessage()).replace("%rank%", plugin.rm.getDisplay(admin).getName()).replace("%coloredrank%", plugin.rm.getDisplay(admin).getColoredName());
|
||||
}
|
||||
}
|
||||
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