mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 09:15:38 +00:00
Using playerMsg(final String message) instead of playerMsg(final CommandSender sender, final String message) when possible.
This commit is contained in:
parent
48fd4c590d
commit
a1c11f4e0f
@ -58,7 +58,7 @@ public class Command_glist extends TFM_Command
|
|||||||
|
|
||||||
if (entry == null)
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ public class Command_halt extends TFM_Command
|
|||||||
{
|
{
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
{
|
{
|
||||||
playerMsg(sender, "Halted players:");
|
playerMsg("Halted players:");
|
||||||
}
|
}
|
||||||
playerMsg("- " + hp.getName());
|
playerMsg("- " + hp.getName());
|
||||||
count++;
|
count++;
|
||||||
|
@ -49,17 +49,17 @@ public class Command_invis extends TFM_Command
|
|||||||
|
|
||||||
if (players.isEmpty())
|
if (players.isEmpty())
|
||||||
{
|
{
|
||||||
playerMsg(sender, "There are no invisible players");
|
playerMsg("There are no invisible players");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (smite)
|
if (smite)
|
||||||
{
|
{
|
||||||
playerMsg(sender, "Smitten " + smites + " players");
|
playerMsg("Smitten " + smites + " players");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
playerMsg(sender, "Invisble players (" + players.size() + "): " + StringUtils.join(players, ", "));
|
playerMsg("Invisble players (" + players.size() + "): " + StringUtils.join(players, ", "));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -47,22 +47,22 @@ public class Command_permban extends TFM_Command
|
|||||||
{
|
{
|
||||||
if (TFM_PermbanList.getPermbannedPlayers().isEmpty())
|
if (TFM_PermbanList.getPermbannedPlayers().isEmpty())
|
||||||
{
|
{
|
||||||
playerMsg(sender, "No permanently banned player names.");
|
playerMsg("No permanently banned player names.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
playerMsg(sender, TFM_PermbanList.getPermbannedPlayers().size() + " permanently banned players:");
|
playerMsg(TFM_PermbanList.getPermbannedPlayers().size() + " permanently banned players:");
|
||||||
playerMsg(sender, StringUtils.join(TFM_PermbanList.getPermbannedPlayers(), ", "));
|
playerMsg(StringUtils.join(TFM_PermbanList.getPermbannedPlayers(), ", "));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TFM_PermbanList.getPermbannedIps().isEmpty())
|
if (TFM_PermbanList.getPermbannedIps().isEmpty())
|
||||||
{
|
{
|
||||||
playerMsg(sender, "No permanently banned IPs.");
|
playerMsg("No permanently banned IPs.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
playerMsg(sender, TFM_PermbanList.getPermbannedIps().size() + " permanently banned IPs:");
|
playerMsg(TFM_PermbanList.getPermbannedIps().size() + " permanently banned IPs:");
|
||||||
playerMsg(sender, StringUtils.join(TFM_PermbanList.getPermbannedIps(), ", "));
|
playerMsg(StringUtils.join(TFM_PermbanList.getPermbannedIps(), ", "));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ public class Command_toggle extends TFM_Command
|
|||||||
}
|
}
|
||||||
catch (NumberFormatException ex)
|
catch (NumberFormatException ex)
|
||||||
{
|
{
|
||||||
playerMsg(sender, ex.getMessage());
|
playerMsg(ex.getMessage());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ public class Command_twitter extends TFM_Command
|
|||||||
{
|
{
|
||||||
if (!TFM_ConfigEntry.TWITTERBOT_ENABLED.getBoolean())
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ public class Command_twitter extends TFM_Command
|
|||||||
|
|
||||||
if (args[1].startsWith("@"))
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,28 +44,28 @@ public class Command_twitter extends TFM_Command
|
|||||||
|
|
||||||
if ("ok".equals(reply))
|
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))
|
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))
|
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))
|
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))
|
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
|
else
|
||||||
{
|
{
|
||||||
playerMsg(sender, "An unknown error occurred, please contact a developer", ChatColor.RED);
|
playerMsg("An unknown error occurred, please contact a developer", ChatColor.RED);
|
||||||
playerMsg(sender, "Response code: " + reply);
|
playerMsg("Response code: " + reply);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -78,33 +78,33 @@ public class Command_twitter extends TFM_Command
|
|||||||
if ("info".equals(args[0]))
|
if ("info".equals(args[0]))
|
||||||
{
|
{
|
||||||
String reply = TFM_TwitterHandler.getTwitter(sender.getName());
|
String reply = TFM_TwitterHandler.getTwitter(sender.getName());
|
||||||
playerMsg(sender, "-- Twitter Information --", ChatColor.BLUE);
|
playerMsg("-- Twitter Information --", ChatColor.BLUE);
|
||||||
playerMsg(sender, "Using this feature, you can re-super yourself using twitter.");
|
playerMsg("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("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("Then, you can verify yourself by tweeting " + ChatColor.AQUA + "@TFUpdates #superme");
|
||||||
if ("notfound".equals(reply))
|
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))
|
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))
|
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))
|
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))
|
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
|
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;
|
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);
|
TFM_Util.adminAction(sender.getName(), ("enable".equals(args[0]) ? "Ena" : "Disa") + "bling Twitterbot", true);
|
||||||
String reply = TFM_TwitterHandler.setEnabled(args[0] + "d");
|
String reply = TFM_TwitterHandler.setEnabled(args[0] + "d");
|
||||||
playerMsg(sender, "Reply: " + reply);
|
playerMsg("Reply: " + reply);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user