summaryrefslogtreecommitdiffstats
path: root/nms-patches/PlayerConnection.patch
diff options
context:
space:
mode:
authorThinkofname <thinkofdeath@spigotmc.org>2016-04-01 23:19:55 +0100
committerThinkofname <thinkofdeath@spigotmc.org>2016-04-01 23:21:09 +0100
commit048849ce51d2cb4bf59b9ec7a8c2b870e83da599 (patch)
tree733c785fa64fe8602e69a03b5460d592ad6618be /nms-patches/PlayerConnection.patch
parent420afc57ef55c910cd7db4285ab6cdc83fc2ce39 (diff)
downloadcraftbukkit-048849ce51d2cb4bf59b9ec7a8c2b870e83da599.tar
craftbukkit-048849ce51d2cb4bf59b9ec7a8c2b870e83da599.tar.gz
craftbukkit-048849ce51d2cb4bf59b9ec7a8c2b870e83da599.tar.lz
craftbukkit-048849ce51d2cb4bf59b9ec7a8c2b870e83da599.tar.xz
craftbukkit-048849ce51d2cb4bf59b9ec7a8c2b870e83da599.zip
SPIGOT-2102: Don't reduce the movement limit below vanilla's default
Diffstat (limited to 'nms-patches/PlayerConnection.patch')
-rw-r--r--nms-patches/PlayerConnection.patch4
1 files changed, 2 insertions, 2 deletions
diff --git a/nms-patches/PlayerConnection.patch b/nms-patches/PlayerConnection.patch
index 1f681ccd..f7329729 100644
--- a/nms-patches/PlayerConnection.patch
+++ b/nms-patches/PlayerConnection.patch
@@ -205,7 +205,7 @@
+ }
+ speed *= 2f; // TODO: Get the speed of the vehicle instead of the player
+
-+ if (d10 - d9 > Math.pow((double) (10.0F * (float) i * speed), 2) && (!this.minecraftServer.R() || !this.minecraftServer.Q().equals(entity.getName()))) {
++ if (d10 - d9 > Math.max(100, Math.pow((double) (10.0F * (float) i * speed), 2)) && (!this.minecraftServer.R() || !this.minecraftServer.Q().equals(entity.getName()))) {
+ // CraftBukkit end
PlayerConnection.LOGGER.warn(entity.getName() + " (vehicle of " + this.player.getName() + ") moved too quickly! " + d6 + "," + d7 + "," + d8);
this.networkManager.sendPacket(new PacketPlayOutVehicleMove(entity));
@@ -327,7 +327,7 @@
float f2 = this.player.cB() ? 300.0F : 100.0F;
- if (d11 - d10 > (double) (f2 * (float) i) && (!this.minecraftServer.R() || !this.minecraftServer.Q().equals(this.player.getName()))) {
-+ if (d11 - d10 > Math.pow((double) (10.0F * (float) i * speed), 2) && (!this.minecraftServer.R() || !this.minecraftServer.Q().equals(this.player.getName()))) {
++ if (d11 - d10 > Math.max(100, Math.pow((double) (10.0F * (float) i * speed), 2)) && (!this.minecraftServer.R() || !this.minecraftServer.Q().equals(this.player.getName()))) {
+ // CraftBukkit end
PlayerConnection.LOGGER.warn(this.player.getName() + " moved too quickly! " + d7 + "," + d8 + "," + d9);
this.a(this.player.locX, this.player.locY, this.player.locZ, this.player.yaw, this.player.pitch);