summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIaccidentally <coryhuckaby@gmail.com>2012-10-28 11:09:49 -0400
committerIaccidentally <coryhuckaby@gmail.com>2012-10-28 11:09:49 -0400
commitb8c63ea816d0dc0554995c5cc3c52c54b2ddbfeb (patch)
treee07ef5bea659f9e50e159ac7d173d991d80eb473
parent31161d7536aa3a20795f4bda60ee29230c95a7d1 (diff)
downloadEssentials-b8c63ea816d0dc0554995c5cc3c52c54b2ddbfeb.tar
Essentials-b8c63ea816d0dc0554995c5cc3c52c54b2ddbfeb.tar.gz
Essentials-b8c63ea816d0dc0554995c5cc3c52c54b2ddbfeb.tar.lz
Essentials-b8c63ea816d0dc0554995c5cc3c52c54b2ddbfeb.tar.xz
Essentials-b8c63ea816d0dc0554995c5cc3c52c54b2ddbfeb.zip
update tppos to not accept coords over 30000000
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtppos.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java b/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java
index 75910cd85..4e78b0e1b 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java
@@ -36,6 +36,10 @@ public class Commandtppos extends EssentialsCommand
{
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(this.getName(), ess);
charge.isAffordableFor(user);
user.sendMessage(_("teleporting"));
@@ -64,8 +68,13 @@ public class Commandtppos extends EssentialsCommand
{
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"));
user.sendMessage(_("teleporting"));
user.getTeleport().teleport(location, null, TeleportCause.COMMAND);
+
}
} \ No newline at end of file