diff options
author | EvilSeph <evilseph@unaligned.org> | 2011-04-25 19:11:44 -0400 |
---|---|---|
committer | EvilSeph <evilseph@unaligned.org> | 2011-04-25 19:11:44 -0400 |
commit | 1d0a6d56b7169a2123256811fabe634fb43c58d8 (patch) | |
tree | 52a1115409970fd31e04bcaf84ebad1544a8604c /src/main/java/net | |
parent | 70c177e0fbd82890fff9df0075bf7bd7c2a8dc7f (diff) | |
download | craftbukkit-1d0a6d56b7169a2123256811fabe634fb43c58d8.tar craftbukkit-1d0a6d56b7169a2123256811fabe634fb43c58d8.tar.gz craftbukkit-1d0a6d56b7169a2123256811fabe634fb43c58d8.tar.lz craftbukkit-1d0a6d56b7169a2123256811fabe634fb43c58d8.tar.xz craftbukkit-1d0a6d56b7169a2123256811fabe634fb43c58d8.zip |
We need to reset the invalid position.
Diffstat (limited to 'src/main/java/net')
-rw-r--r-- | src/main/java/net/minecraft/server/NetServerHandler.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index 12c2cd4f..7992444e 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -147,30 +147,35 @@ public class NetServerHandler extends NetHandler implements ICommandListener { } if (Math.abs(packet10flying.x) > 32000000 || Math.abs(packet10flying.z) > 32000000) { + player.teleport(player.getServer().getWorld(player.getWorld().getName()).getSpawnLocation()); System.err.println(player.getName() + " was caught trying to crash the server with an invalid position."); player.kickPlayer("Nope!"); return; } if (Double.isNaN(packet10flying.x) || packet10flying.x == Double.POSITIVE_INFINITY || packet10flying.x == Double.NEGATIVE_INFINITY) { + player.teleport(player.getServer().getWorld(player.getWorld().getName()).getSpawnLocation()); System.err.println(player.getName() + " was caught trying to set an invalid position."); player.kickPlayer("Nope!"); return; } if (Double.isNaN(packet10flying.y) || packet10flying.y == Double.POSITIVE_INFINITY || packet10flying.y == Double.NEGATIVE_INFINITY) { + player.teleport(player.getServer().getWorld(player.getWorld().getName()).getSpawnLocation()); System.err.println(player.getName() + " was caught trying to set an invalid position."); player.kickPlayer("Nope!"); return; } if (Double.isNaN(packet10flying.z) || packet10flying.z == Double.POSITIVE_INFINITY || packet10flying.z == Double.NEGATIVE_INFINITY) { + player.teleport(player.getServer().getWorld(player.getWorld().getName()).getSpawnLocation()); System.err.println(player.getName() + " was caught trying to set an invalid position."); player.kickPlayer("Nope!"); return; } if (Double.isNaN(packet10flying.stance) || packet10flying.stance == Double.POSITIVE_INFINITY || packet10flying.stance == Double.NEGATIVE_INFINITY) { + player.teleport(player.getServer().getWorld(player.getWorld().getName()).getSpawnLocation()); System.err.println(player.getName() + " was caught trying to set an invalid position."); player.kickPlayer("Nope!"); return; |