From a1c11f4e0fb4b0af34826b20c8caecbc783d06fb Mon Sep 17 00:00:00 2001 From: StevenLawson Date: Thu, 14 Aug 2014 15:49:48 -0400 Subject: [PATCH] Using playerMsg(final String message) instead of playerMsg(final CommandSender sender, final String message) when possible. --- .../Commands/Command_glist.java | 2 +- .../Commands/Command_halt.java | 2 +- .../Commands/Command_invis.java | 6 +-- .../Commands/Command_permban.java | 12 +++--- .../Commands/Command_toggle.java | 2 +- .../Commands/Command_twitter.java | 40 +++++++++---------- 6 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_glist.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_glist.java index d813b3b5..091550f0 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_glist.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_glist.java @@ -58,7 +58,7 @@ public class Command_glist extends TFM_Command if (entry == null) { - playerMsg(sender, "Can't find that user. If target is not logged in, make sure that you spelled the name exactly."); + playerMsg("Can't find that user. If target is not logged in, make sure that you spelled the name exactly."); return true; } diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_halt.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_halt.java index e29c5e48..2a5dd546 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_halt.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_halt.java @@ -64,7 +64,7 @@ public class Command_halt extends TFM_Command { if (count == 0) { - playerMsg(sender, "Halted players:"); + playerMsg("Halted players:"); } playerMsg("- " + hp.getName()); count++; diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_invis.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_invis.java index 114096b0..b6023c58 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_invis.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_invis.java @@ -49,17 +49,17 @@ public class Command_invis extends TFM_Command if (players.isEmpty()) { - playerMsg(sender, "There are no invisible players"); + playerMsg("There are no invisible players"); return true; } if (smite) { - playerMsg(sender, "Smitten " + smites + " players"); + playerMsg("Smitten " + smites + " players"); } else { - playerMsg(sender, "Invisble players (" + players.size() + "): " + StringUtils.join(players, ", ")); + playerMsg("Invisble players (" + players.size() + "): " + StringUtils.join(players, ", ")); } return true; diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_permban.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_permban.java index e4cf1589..ee49140a 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_permban.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_permban.java @@ -47,22 +47,22 @@ public class Command_permban extends TFM_Command { if (TFM_PermbanList.getPermbannedPlayers().isEmpty()) { - playerMsg(sender, "No permanently banned player names."); + playerMsg("No permanently banned player names."); } else { - playerMsg(sender, TFM_PermbanList.getPermbannedPlayers().size() + " permanently banned players:"); - playerMsg(sender, StringUtils.join(TFM_PermbanList.getPermbannedPlayers(), ", ")); + playerMsg(TFM_PermbanList.getPermbannedPlayers().size() + " permanently banned players:"); + playerMsg(StringUtils.join(TFM_PermbanList.getPermbannedPlayers(), ", ")); } if (TFM_PermbanList.getPermbannedIps().isEmpty()) { - playerMsg(sender, "No permanently banned IPs."); + playerMsg("No permanently banned IPs."); } else { - playerMsg(sender, TFM_PermbanList.getPermbannedIps().size() + " permanently banned IPs:"); - playerMsg(sender, StringUtils.join(TFM_PermbanList.getPermbannedIps(), ", ")); + playerMsg(TFM_PermbanList.getPermbannedIps().size() + " permanently banned IPs:"); + playerMsg(StringUtils.join(TFM_PermbanList.getPermbannedIps(), ", ")); } } } diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_toggle.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_toggle.java index aec30b24..e64eae39 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_toggle.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_toggle.java @@ -141,7 +141,7 @@ public class Command_toggle extends TFM_Command } catch (NumberFormatException ex) { - playerMsg(sender, ex.getMessage()); + playerMsg(ex.getMessage()); return true; } } diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_twitter.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_twitter.java index 86af14a0..11c9e5ed 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_twitter.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_twitter.java @@ -18,7 +18,7 @@ public class Command_twitter extends TFM_Command { if (!TFM_ConfigEntry.TWITTERBOT_ENABLED.getBoolean()) { - playerMsg(sender, "TwitterBot has been disabled in config.", ChatColor.RED); + playerMsg("TwitterBot has been disabled in config.", ChatColor.RED); return true; } @@ -36,7 +36,7 @@ public class Command_twitter extends TFM_Command if (args[1].startsWith("@")) { - playerMsg(sender, "Please do not prefix your twitter username with '@'"); + playerMsg("Please do not prefix your twitter username with '@'"); return true; } @@ -44,28 +44,28 @@ public class Command_twitter extends TFM_Command if ("ok".equals(reply)) { - playerMsg(sender, "Your twitter handle has been set to: " + ChatColor.AQUA + "@" + args[1] + ChatColor.GRAY + "."); + playerMsg("Your twitter handle has been set to: " + ChatColor.AQUA + "@" + args[1] + ChatColor.GRAY + "."); } else if ("disabled".equals(reply)) { - playerMsg(sender, "TwitterBot has been temporarily disabled,, please wait until it get re-enabled", ChatColor.RED); + playerMsg("TwitterBot has been temporarily disabled,, please wait until it get re-enabled", ChatColor.RED); } else if ("failed".equals(reply)) { - playerMsg(sender, "There was a problem querying the database, please let a developer know.", ChatColor.RED); + playerMsg("There was a problem querying the database, please let a developer know.", ChatColor.RED); } else if ("false".equals(reply)) { - playerMsg(sender, "There was a problem with the database, please let a developer know.", ChatColor.RED); + playerMsg("There was a problem with the database, please let a developer know.", ChatColor.RED); } else if ("cannotauth".equals(reply)) { - playerMsg(sender, "The database password is incorrect, please let a developer know.", ChatColor.RED); + playerMsg("The database password is incorrect, please let a developer know.", ChatColor.RED); } else { - playerMsg(sender, "An unknown error occurred, please contact a developer", ChatColor.RED); - playerMsg(sender, "Response code: " + reply); + playerMsg("An unknown error occurred, please contact a developer", ChatColor.RED); + playerMsg("Response code: " + reply); } return true; } @@ -78,33 +78,33 @@ public class Command_twitter extends TFM_Command if ("info".equals(args[0])) { String reply = TFM_TwitterHandler.getTwitter(sender.getName()); - playerMsg(sender, "-- Twitter Information --", ChatColor.BLUE); - playerMsg(sender, "Using this feature, you can re-super yourself using twitter."); - playerMsg(sender, "You can set your twitter handle using " + ChatColor.AQUA + "/twitter set [twittername]"); - playerMsg(sender, "Then, you can verify yourself by tweeting " + ChatColor.AQUA + "@TFUpdates #superme"); + playerMsg("-- Twitter Information --", ChatColor.BLUE); + playerMsg("Using this feature, you can re-super yourself using twitter."); + playerMsg("You can set your twitter handle using " + ChatColor.AQUA + "/twitter set [twittername]"); + playerMsg("Then, you can verify yourself by tweeting " + ChatColor.AQUA + "@TFUpdates #superme"); if ("notfound".equals(reply)) { - playerMsg(sender, "You currently have " + ChatColor.RED + "no" + ChatColor.BLUE + " Twitter handle set.", ChatColor.BLUE); + playerMsg("You currently have " + ChatColor.RED + "no" + ChatColor.BLUE + " Twitter handle set.", ChatColor.BLUE); } else if ("disabled".equals(reply)) { - playerMsg(sender, "TwitterBot has been temporarily disabled, please wait until re-enabled", ChatColor.RED); + playerMsg("TwitterBot has been temporarily disabled, please wait until re-enabled", ChatColor.RED); } else if ("failed".equals(reply)) { - playerMsg(sender, "There was a problem querying the database, please let a developer know.", ChatColor.RED); + playerMsg("There was a problem querying the database, please let a developer know.", ChatColor.RED); } else if ("false".equals(reply)) { - playerMsg(sender, "There was a problem with the database, please let a developer know.", ChatColor.RED); + playerMsg("There was a problem with the database, please let a developer know.", ChatColor.RED); } else if ("cannotauth".equals(reply)) { - playerMsg(sender, "The database password is incorrect, please let a developer know.", ChatColor.RED); + playerMsg("The database password is incorrect, please let a developer know.", ChatColor.RED); } else { - playerMsg(sender, "Your current twitter handle: " + ChatColor.AQUA + "@" + reply + ChatColor.BLUE + ".", ChatColor.BLUE); + playerMsg("Your current twitter handle: " + ChatColor.AQUA + "@" + reply + ChatColor.BLUE + ".", ChatColor.BLUE); } return true; } @@ -119,7 +119,7 @@ public class Command_twitter extends TFM_Command TFM_Util.adminAction(sender.getName(), ("enable".equals(args[0]) ? "Ena" : "Disa") + "bling Twitterbot", true); String reply = TFM_TwitterHandler.setEnabled(args[0] + "d"); - playerMsg(sender, "Reply: " + reply); + playerMsg("Reply: " + reply); return true; }