Use TFM_Command.playerMsg instead of TFM_Util.playerMsg for commands.

This commit is contained in:
StevenLawson 2014-08-13 20:56:04 -04:00
parent 97cde0cfd4
commit 48fd4c590d
6 changed files with 27 additions and 29 deletions

View File

@ -46,7 +46,7 @@ public class Command_fr extends TFM_Command
{
if (!TFM_AdminList.isSuperAdmin(player))
{
TFM_Util.playerMsg(player, "You have been frozen due to rule breaker(s), you will be unfrozen very soon.", ChatColor.RED);
playerMsg(player, "You have been frozen due to rule breaker(s), you will be unfrozen very soon.", ChatColor.RED);
}
}
}

View File

@ -58,7 +58,7 @@ public class Command_glist extends TFM_Command
if (entry == null)
{
TFM_Util.playerMsg(sender, "Can't find that user. If target is not logged in, make sure that you spelled the name exactly.");
playerMsg(sender, "Can't find that user. If target is not logged in, make sure that you spelled the name exactly.");
return true;
}

View File

@ -49,20 +49,19 @@ public class Command_invis extends TFM_Command
if (players.isEmpty())
{
TFM_Util.playerMsg(sender, "There are no invisible players");
playerMsg(sender, "There are no invisible players");
return true;
}
if (smite)
{
TFM_Util.playerMsg(sender, "Smitten " + smites + " players");
playerMsg(sender, "Smitten " + smites + " players");
}
else
{
TFM_Util.playerMsg(sender, "Invisble players (" + players.size() + "): " + StringUtils.join(players, ", "));
playerMsg(sender, "Invisble players (" + players.size() + "): " + StringUtils.join(players, ", "));
}
return true;
}
}

View File

@ -8,7 +8,6 @@ import me.StevenLawson.TotalFreedomMod.TFM_TwitterHandler;
import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import net.minecraft.util.org.apache.commons.lang3.StringUtils;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
@ -175,7 +174,7 @@ public class Command_saconfig extends TFM_Command
if (playerdata.isFrozen())
{
playerdata.setFrozen(false);
TFM_Util.playerMsg((Player) player, "You have been unfrozen.");
playerMsg((Player) player, "You have been unfrozen.");
}
}

View File

@ -141,7 +141,7 @@ public class Command_toggle extends TFM_Command
}
catch (NumberFormatException ex)
{
TFM_Util.playerMsg(sender, ex.getMessage());
playerMsg(sender, ex.getMessage());
return true;
}
}

View File

@ -18,7 +18,7 @@ public class Command_twitter extends TFM_Command
{
if (!TFM_ConfigEntry.TWITTERBOT_ENABLED.getBoolean())
{
TFM_Util.playerMsg(sender, "TwitterBot has been disabled in config.", ChatColor.RED);
playerMsg(sender, "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("@"))
{
TFM_Util.playerMsg(sender, "Please do not prefix your twitter username with '@'");
playerMsg(sender, "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))
{
TFM_Util.playerMsg(sender, "Your twitter handle has been set to: " + ChatColor.AQUA + "@" + args[1] + ChatColor.GRAY + ".");
playerMsg(sender, "Your twitter handle has been set to: " + ChatColor.AQUA + "@" + args[1] + ChatColor.GRAY + ".");
}
else if ("disabled".equals(reply))
{
TFM_Util.playerMsg(sender, "TwitterBot has been temporarily disabled,, please wait until it get re-enabled", ChatColor.RED);
playerMsg(sender, "TwitterBot has been temporarily disabled,, please wait until it get re-enabled", ChatColor.RED);
}
else if ("failed".equals(reply))
{
TFM_Util.playerMsg(sender, "There was a problem querying the database, please let a developer know.", ChatColor.RED);
playerMsg(sender, "There was a problem querying the database, please let a developer know.", ChatColor.RED);
}
else if ("false".equals(reply))
{
TFM_Util.playerMsg(sender, "There was a problem with the database, please let a developer know.", ChatColor.RED);
playerMsg(sender, "There was a problem with the database, please let a developer know.", ChatColor.RED);
}
else if ("cannotauth".equals(reply))
{
TFM_Util.playerMsg(sender, "The database password is incorrect, please let a developer know.", ChatColor.RED);
playerMsg(sender, "The database password is incorrect, please let a developer know.", ChatColor.RED);
}
else
{
TFM_Util.playerMsg(sender, "An unknown error occurred, please contact a developer", ChatColor.RED);
TFM_Util.playerMsg(sender, "Response code: " + reply);
playerMsg(sender, "An unknown error occurred, please contact a developer", ChatColor.RED);
playerMsg(sender, "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());
TFM_Util.playerMsg(sender, "-- Twitter Information --", ChatColor.BLUE);
TFM_Util.playerMsg(sender, "Using this feature, you can re-super yourself using twitter.");
TFM_Util.playerMsg(sender, "You can set your twitter handle using " + ChatColor.AQUA + "/twitter set [twittername]");
TFM_Util.playerMsg(sender, "Then, you can verify yourself by tweeting " + ChatColor.AQUA + "@TFUpdates #superme");
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");
if ("notfound".equals(reply))
{
TFM_Util.playerMsg(sender, "You currently have " + ChatColor.RED + "no" + ChatColor.BLUE + " Twitter handle set.", ChatColor.BLUE);
playerMsg(sender, "You currently have " + ChatColor.RED + "no" + ChatColor.BLUE + " Twitter handle set.", ChatColor.BLUE);
}
else if ("disabled".equals(reply))
{
TFM_Util.playerMsg(sender, "TwitterBot has been temporarily disabled, please wait until re-enabled", ChatColor.RED);
playerMsg(sender, "TwitterBot has been temporarily disabled, please wait until re-enabled", ChatColor.RED);
}
else if ("failed".equals(reply))
{
TFM_Util.playerMsg(sender, "There was a problem querying the database, please let a developer know.", ChatColor.RED);
playerMsg(sender, "There was a problem querying the database, please let a developer know.", ChatColor.RED);
}
else if ("false".equals(reply))
{
TFM_Util.playerMsg(sender, "There was a problem with the database, please let a developer know.", ChatColor.RED);
playerMsg(sender, "There was a problem with the database, please let a developer know.", ChatColor.RED);
}
else if ("cannotauth".equals(reply))
{
TFM_Util.playerMsg(sender, "The database password is incorrect, please let a developer know.", ChatColor.RED);
playerMsg(sender, "The database password is incorrect, please let a developer know.", ChatColor.RED);
}
else
{
TFM_Util.playerMsg(sender, "Your current twitter handle: " + ChatColor.AQUA + "@" + reply + ChatColor.BLUE + ".", ChatColor.BLUE);
playerMsg(sender, "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");
TFM_Util.playerMsg(sender, "Reply: " + reply);
playerMsg(sender, "Reply: " + reply);
return true;
}