Prevent teleporting to invalid coordinates

This commit is contained in:
boy0001
2015-08-28 16:36:26 +10:00
parent 1e8bdb17f8
commit 0dbb1887d5
4 changed files with 6 additions and 0 deletions

View File

@ -111,6 +111,9 @@ public class SpongePlayer extends PlotPlayer {
@Override
public void teleport(Location loc) {
if (Math.abs(loc.getX()) >= 30000000 || Math.abs(loc.getZ()) >= 30000000) {
return;
}
String world = player.getWorld().getName();
if (!world.equals(loc.getWorld())) {
player.transferToWorld(loc.getWorld(), new Vector3d(loc.getX(), loc.getY(), loc.getZ()));