diff --git a/nms-patches/PlayerConnection.patch b/nms-patches/PlayerConnection.patch index 38c8b99966..b0ae338044 100644 --- a/nms-patches/PlayerConnection.patch +++ b/nms-patches/PlayerConnection.patch @@ -1,5 +1,5 @@ ---- ../work/decompile-8eb82bde/net/minecraft/server/PlayerConnection.java 2015-02-20 15:17:19.419840293 +1100 -+++ src/main/java/net/minecraft/server/PlayerConnection.java 2015-02-20 15:17:19.423840297 +1100 +--- ../work/decompile-8eb82bde/net/minecraft/server/PlayerConnection.java 2015-02-26 21:28:11.874168704 +1100 ++++ src/main/java/net/minecraft/server/PlayerConnection.java 2015-02-26 21:28:11.878168702 +1100 @@ -16,6 +16,48 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -151,7 +151,7 @@ public void a(PacketPlayInFlying packetplayinflying) { PlayerConnectionUtils.ensureMainThread(packetplayinflying, this, this.player.u()); + // CraftBukkit start - Check for NaN -+ if (Double.isNaN(packetplayinflying.x) || Double.isNaN(packetplayinflying.y) || Double.isNaN(packetplayinflying.z)) { ++ if (!NumberConversions.isFinite(packetplayinflying.x) || !NumberConversions.isFinite(packetplayinflying.y) || !NumberConversions.isFinite(packetplayinflying.z)) { + c.warn(player.getName() + " was caught trying to crash the server with an invalid position."); + getPlayer().kickPlayer("Nope!"); + return;