1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-14 10:34:41 +02:00

Update tppos to not accept coords over 30000000

This commit is contained in:
Iaccidentally
2012-10-28 11:14:14 -04:00
parent 689b9ebf22
commit 2338a4ef26

View File

@@ -30,6 +30,10 @@ public class Commandtppos extends EssentialsCommand
{ {
location.setPitch(Float.parseFloat(args[4])); location.setPitch(Float.parseFloat(args[4]));
} }
if (x > 30000000 || y > 30000000 || z > 30000000 || x < -30000000 || y < 30000000 || z < 30000000)
{
throw new NotEnoughArgumentsException("Value of coordinates cannot be over 30000000"); //todo: I18n
}
final Trade charge = new Trade(commandName, ess); final Trade charge = new Trade(commandName, ess);
charge.isAffordableFor(user); charge.isAffordableFor(user);
user.sendMessage(_("teleporting")); user.sendMessage(_("teleporting"));
@@ -58,6 +62,10 @@ public class Commandtppos extends EssentialsCommand
{ {
location.setPitch(Float.parseFloat(args[5])); location.setPitch(Float.parseFloat(args[5]));
} }
if (x > 30000000 || y > 30000000 || z > 30000000 || x < -30000000 || y < 30000000 || z < 30000000)
{
throw new NotEnoughArgumentsException("Value of coordinates cannot be over 30000000"); //todo: I18n
}
sender.sendMessage(_("teleporting")); sender.sendMessage(_("teleporting"));
user.sendMessage(_("teleporting")); user.sendMessage(_("teleporting"));
user.getTeleport().teleport(location, null, TeleportCause.COMMAND); user.getTeleport().teleport(location, null, TeleportCause.COMMAND);