mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-05 12:02:53 +00:00
update tppos to not accept coords over 30000000
This commit is contained in:
parent
9864a75c32
commit
6f213c23e2
1 changed files with 9 additions and 0 deletions
|
@ -36,6 +36,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(this.getName(), ess);
|
final Trade charge = new Trade(this.getName(), ess);
|
||||||
charge.isAffordableFor(user);
|
charge.isAffordableFor(user);
|
||||||
user.sendMessage(_("teleporting"));
|
user.sendMessage(_("teleporting"));
|
||||||
|
@ -64,8 +68,13 @@ 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);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue