diff options
author | Nate Mortensen <nate.richard.mortensen@gmail.com> | 2014-01-16 18:23:08 -0700 |
---|---|---|
committer | Nate Mortensen <nate.richard.mortensen@gmail.com> | 2014-01-29 18:13:14 -0700 |
commit | e4ba663d2a8de53edf25b954ad3dfacfdbf77199 (patch) | |
tree | e924ca548213d7aacce0400028eb3ec0a017d3d5 /src/main/java/net/minecraft | |
parent | 6e6ad530e720a85f3f209bd8ca2ca40f9982211c (diff) | |
download | craftbukkit-e4ba663d2a8de53edf25b954ad3dfacfdbf77199.tar craftbukkit-e4ba663d2a8de53edf25b954ad3dfacfdbf77199.tar.gz craftbukkit-e4ba663d2a8de53edf25b954ad3dfacfdbf77199.tar.lz craftbukkit-e4ba663d2a8de53edf25b954ad3dfacfdbf77199.tar.xz craftbukkit-e4ba663d2a8de53edf25b954ad3dfacfdbf77199.zip |
Relocate NaN check on PacketPlayInFlying.
Diffstat (limited to 'src/main/java/net/minecraft')
-rw-r--r-- | src/main/java/net/minecraft/server/PlayerConnection.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java index 29335eac..ee6b0a1e 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -179,6 +179,13 @@ public class PlayerConnection implements PacketPlayInListener { } public void a(PacketPlayInFlying packetplayinflying) { + // CraftBukkit start - Check for NaN + if (Double.isNaN(packetplayinflying.x) || Double.isNaN(packetplayinflying.y) || Double.isNaN(packetplayinflying.z) || Double.isNaN(packetplayinflying.stance)) { + c.warn(player.getName() + " was caught trying to crash the server with an invalid position."); + getPlayer().kickPlayer("Nope!"); + return; + } + // CraftBukkit end WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); this.g = true; @@ -249,13 +256,6 @@ public class PlayerConnection implements PacketPlayInListener { } } - if (Double.isNaN(packetplayinflying.x) || Double.isNaN(packetplayinflying.y) || Double.isNaN(packetplayinflying.z) || Double.isNaN(packetplayinflying.stance)) { - player.teleport(player.getWorld().getSpawnLocation(), PlayerTeleportEvent.TeleportCause.UNKNOWN); - System.err.println(player.getName() + " was caught trying to crash the server with an invalid position."); - player.kickPlayer("Nope!"); - return; - } - if (this.checkMovement && !this.player.dead) { // CraftBukkit end double d1; |