2022-10-03 16:44:19 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: FriwiDev <friwidev@gmail.com>
Date: Mon, 3 Oct 2022 18:16:30 +0200
Subject: [PATCH] Fix nothing mlg
2022-10-03 17:07:03 +00:00
The issue here is that when jumping and sneaking right before
the end of a long fall, the client will send incorrect move
packets resulting in a teleport back. Due to this, the move
packet (impact) of the player will not be considered for fall
damage. The following move packet to the impact packet will
have a positive y-value again due to the player jumping,
resulting in a fall damage reset.
2022-10-03 16:44:19 +00:00
2022-10-03 17:07:03 +00:00
Solution: Apply fall damage also while moving wrongly, but
supply the real values the player sent to the damage calculation.
This will not have any real negative effect, as the
doCheckFallDamage method is meant to be called repeatedly anyway.
2022-10-03 16:44:19 +00:00
Mojira-ID: MC-255653
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
2022-10-23 18:52:40 +00:00
index 8a35db69e986c393bf56ae556ea28adff91da08d..9ad36447e82a3504576f6c10cb297514a2f69289 100644
2022-10-03 16:44:19 +00:00
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1564,6 +1564,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
if (!this.player.noPhysics && !this.player.isSleeping() && teleportBack) { // Paper end - optimise out extra getCubes
this.internalTeleport(d3, d4, d5, f, f1, Collections.emptySet(), false); // CraftBukkit - SPIGOT-1807: Don't call teleport event, when the client thinks the player is falling, because the chunks are not loaded on the client yet.
2022-10-03 17:07:03 +00:00
+ this.player.doCheckFallDamage(this.player.getY() - prevY, packet.isOnGround()); // Paper - fix nothing mlg (sneaking and jumping before impact)
2022-10-03 16:44:19 +00:00
} else {
// CraftBukkit start - fire PlayerMoveEvent
// Rest to old location first