Removed some redundancies and deprecation messages

This commit is contained in:
MarioE 2012-06-03 10:39:22 -04:00
parent 2c769410f8
commit 6ff2fed60b

View file

@ -97,7 +97,7 @@ namespace TShockAPI
} }
catch (Exception e) catch (Exception e)
{ {
ply.SendMessage("Command failed, check logs for more details."); ply.SendErrorMessage("Command failed, check logs for more details.");
Log.Error(e.ToString()); Log.Error(e.ToString());
} }
@ -1263,36 +1263,18 @@ namespace TShockAPI
private static void Home(CommandArgs args) private static void Home(CommandArgs args)
{ {
if (!args.Player.RealPlayer)
{
args.Player.SendErrorMessage("You cannot use teleport commands!");
return;
}
args.Player.Spawn(); args.Player.Spawn();
args.Player.SendSuccessMessage("Teleported to your spawnpoint."); args.Player.SendSuccessMessage("Teleported to your spawnpoint.");
} }
private static void Spawn(CommandArgs args) private static void Spawn(CommandArgs args)
{ {
if (!args.Player.RealPlayer)
{
args.Player.SendErrorMessage("You cannot use teleport commands!");
return;
}
if (args.Player.Teleport(Main.spawnTileX, Main.spawnTileY)) if (args.Player.Teleport(Main.spawnTileX, Main.spawnTileY))
args.Player.SendSuccessMessage("Teleported to the map's spawnpoint."); args.Player.SendSuccessMessage("Teleported to the map's spawnpoint.");
} }
private static void TP(CommandArgs args) private static void TP(CommandArgs args)
{ {
if (!args.Player.RealPlayer)
{
args.Player.SendErrorMessage("You cannot use teleport commands!");
return;
}
if (args.Parameters.Count < 1) if (args.Parameters.Count < 1)
{ {
args.Player.SendErrorMessage("Invalid syntax! Proper syntax: /tp <player> "); args.Player.SendErrorMessage("Invalid syntax! Proper syntax: /tp <player> ");
@ -1325,12 +1307,6 @@ namespace TShockAPI
private static void TPHere(CommandArgs args) private static void TPHere(CommandArgs args)
{ {
if (!args.Player.RealPlayer)
{
args.Player.SendErrorMessage("You cannot use teleport commands!");
return;
}
if (args.Parameters.Count < 1) if (args.Parameters.Count < 1)
{ {
args.Player.SendErrorMessage("Invalid syntax! Proper syntax: /tphere <player> "); args.Player.SendErrorMessage("Invalid syntax! Proper syntax: /tphere <player> ");
@ -1347,7 +1323,7 @@ namespace TShockAPI
if (Main.player[i].active && (Main.player[i] != args.TPlayer)) if (Main.player[i].active && (Main.player[i] != args.TPlayer))
{ {
if (TShock.Players[i].Teleport(args.Player.TileX, args.Player.TileY + 3)) if (TShock.Players[i].Teleport(args.Player.TileX, args.Player.TileY + 3))
TShock.Players[i].SendMessage(string.Format("You were teleported to {0}.", args.Player.Name) + "."); TShock.Players[i].SendSuccessMessage(string.Format("You were teleported to {0}.", args.Player.Name) + ".");
} }
} }
return; return;
@ -1376,9 +1352,9 @@ namespace TShockAPI
private static void TPAllow(CommandArgs args) private static void TPAllow(CommandArgs args)
{ {
if (!args.Player.TPAllow) if (!args.Player.TPAllow)
args.Player.SendMessage("You have removed your teleportation protection."); args.Player.SendSuccessMessage("You have removed your teleportation protection.");
if (args.Player.TPAllow) if (args.Player.TPAllow)
args.Player.SendMessage("You have enabled teleportation protection."); args.Player.SendSuccessMessage("You have enabled teleportation protection.");
args.Player.TPAllow = !args.Player.TPAllow; args.Player.TPAllow = !args.Player.TPAllow;
} }
@ -2842,7 +2818,7 @@ namespace TShockAPI
TShock.Utils.GetBuffDescription(id), (time))); TShock.Utils.GetBuffDescription(id), (time)));
} }
else else
args.Player.SendMessage("Invalid buff ID!"); args.Player.SendErrorMessage("Invalid buff ID!");
} }
} }