From 575818ba691e42b3aabbee1b11d3205fb95b5528 Mon Sep 17 00:00:00 2001 From: ZeroEpoch1969 <13510767+ZeroEpoch1969@users.noreply.github.com> Date: Thu, 26 Jul 2018 03:09:33 -0700 Subject: [PATCH] It's 3AM so time for random commit titles: Longboi Johnson --- .../totalfreedommod/command/Command_myadmin.java | 14 +------------- .../totalfreedommod/rank/RankManager.java | 9 +-------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_myadmin.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_myadmin.java index ec42cbb9..b49abc9e 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_myadmin.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_myadmin.java @@ -143,22 +143,10 @@ public class Command_myadmin extends FreedomCommand } String msg = StringUtils.join(args, " ", 1, args.length); - if (!msg.contains("%name%")) - { - msg("You login message must contain your name. To add it, specify %name% where you want it.", ChatColor.RED); - return true; - } 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: "); - if (msg.contains("%name%")) - { - msg("> " + FUtil.colorize(msg).replace("%name%", targetPlayer.getName())); - } - else - { - msg("> " + ChatColor.AQUA + targetPlayer.getName() + " is " + ChatUtils.colorize(target.getLoginMessage())); - } + msg("> " + ChatColor.AQUA + (msg.contains("%name%") ? "" : target.getName() + " is ") + FUtil.colorize(msg).replace("%name%", targetPlayer.getName())); plugin.al.save(); plugin.al.updateTables(); return true; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/rank/RankManager.java b/src/main/java/me/totalfreedom/totalfreedommod/rank/RankManager.java index 5e2c8c83..703c4e6f 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/rank/RankManager.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/rank/RankManager.java @@ -209,14 +209,7 @@ public class RankManager extends FreedomService loginMsg = ChatUtils.colorize(admin.getLoginMessage()); } } - if (loginMsg.contains("%name%")) - { - FUtil.bcastMsg(loginMsg.replace("%name%", player.getName())); - } - else - { - FUtil.bcastMsg(ChatColor.AQUA + player.getName() + " is " + loginMsg); - } + FUtil.bcastMsg(ChatColor.AQUA + (loginMsg.contains("%name%") ? "" : player.getName() + " is ") + FUtil.colorize(loginMsg).replace("%name%", player.getName())); plugin.pl.getPlayer(player).setTag(display.getColoredTag()); if (isAdmin)