mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 13:06:02 +01:00
SPIGOT-602: Kick players with non-finite locations
This commit is contained in:
parent
ee6d0fa938
commit
33d5de312e
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user