summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2015-02-26 21:28:38 +1100
committermd_5 <git@md-5.net>2015-02-26 21:28:38 +1100
commit33d5de312e9fcc8aec3fc53136658cb6920562aa (patch)
tree7d975e49a7ac45b0a1ca2856e27674849db862c5
parentee6d0fa9384fba4be2efe5ea2a0e06ba7df8df11 (diff)
downloadcraftbukkit-33d5de312e9fcc8aec3fc53136658cb6920562aa.tar
craftbukkit-33d5de312e9fcc8aec3fc53136658cb6920562aa.tar.gz
craftbukkit-33d5de312e9fcc8aec3fc53136658cb6920562aa.tar.lz
craftbukkit-33d5de312e9fcc8aec3fc53136658cb6920562aa.tar.xz
craftbukkit-33d5de312e9fcc8aec3fc53136658cb6920562aa.zip
SPIGOT-602: Kick players with non-finite locations
-rw-r--r--nms-patches/PlayerConnection.patch6
1 files changed, 3 insertions, 3 deletions
diff --git a/nms-patches/PlayerConnection.patch b/nms-patches/PlayerConnection.patch
index 38c8b999..b0ae3380 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;