summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/net/minecraft/server/NetServerHandler.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java
index d60d4b49..fd22945f 100644
--- a/src/main/java/net/minecraft/server/NetServerHandler.java
+++ b/src/main/java/net/minecraft/server/NetServerHandler.java
@@ -143,6 +143,18 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
this.lastYaw = this.e.yaw;
this.lastPitch = this.e.pitch;
}
+
+ if (Math.abs(packet10flying.a) > 32000000 || Math.abs(packet10flying.c) > 32000000) {
+ System.err.println(player.getName() + " was caught trying to crash the server with an invalid position.");
+ player.kickPlayer("Nope!");
+ return;
+ }
+
+ if (Math.abs(packet10flying.c) > 32000000) {
+ System.err.println(player.getName() + " was caught trying to crash the server with an invalid position.");
+ player.kickPlayer("Nope!");
+ return;
+ }
// CraftBukkit end
if (this.l) {