You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -1508,7 +1508,7 @@ private double[] vDistRel(final Player player, final PlayerLocation from,
1508
1508
// NOTE: pressing space bar on a bouncy block will override the bounce (in that case, vdistrel will fall back to the jump check above).
1509
1509
// updateEntityAfterFallOn(), this function is called on the next move
1510
1510
if (pData.isShiftKeyPressed() && lastMove.collideY) {
1511
-
if (lastMove.yAllowedDistance < 0.0) { // NOTE: Must be the allowed distance, not the actual one (exploit)
1511
+
if (thisMove.yAllowedDistance < 0.0) { // NOTE: Must be the allowed distance, not the actual one (exploit)
1512
1512
if (lastMove.to.onBouncyBlock) {
1513
1513
// The effect works by inverting the distance.
1514
1514
// Beds have a weaker bounce effect (BedBlock.java).
@@ -1532,13 +1532,13 @@ private double[] vDistRel(final Player player, final PlayerLocation from,
1532
1532
thisMove.yAllowedDistance = 0.0;
1533
1533
}
1534
1534
}
1535
-
// *----------Finalization of handleRelativeFrictionAndCalculateMovement; this check/condition is called after having called the move(). The former method is called only when the player is traveling in air, thus the liquid and gliding checks ----------*
1535
+
// *----------Finalization of handleRelativeFrictionAndCalculateMovement; this check/condition is called after having called the move() function. The former method is called only when the player is traveling in air, thus the liquid and gliding checks ----------*
1536
1536
if (!lastMove.from.inLiquid && !lastMove.isGliding) {
1537
1537
// TODO: Which condition is correct ??? Check for past versions to see when this check changed... Fun.
// TODO: We have to loop the jumping state for 1.21.1 and below... No other way to put it unfortunately. This will make the code an ugly mess than it already is.
if (jumpedOrCollided && (lastMove.from.onClimbable || lastMove.from.inPowderSnow && BridgeMisc.canStandOnPowderSnow(player))) { // this.wasInPowderSnow. The living entity field already checks for the past state, does that mean we need to check for the second last move?
1543
1543
thisMove.yAllowedDistance = 0.2;
1544
1544
}
@@ -1838,6 +1838,7 @@ private double[] hDistAfterFailure(final Player player,
1838
1838
* Because this move is not sent by the client and cannot be predicted through normal means, we have to brute force it.
1839
1839
*/
1840
1840
if (hDistanceAboveLimit > 0.0 && lastMove.isPossibleStoppingMotion(pData.getClientVersion())) {
1841
+
tags.add("stop_motion");
1841
1842
double[] res = prepareSpeedEstimation(from, to, pData, player, data, thisMove, lastMove, fromOnGround, toOnGround, debug, isNormalOrPacketSplitMove, false, false);
1842
1843
hAllowedDistance = res[0];
1843
1844
hDistanceAboveLimit = res[1];
@@ -1846,6 +1847,7 @@ private double[] hDistAfterFailure(final Player player,
1846
1847
* 2: Undetectable jump (must brute force here): player failed with the onGround flag, lets try with off-ground then.
1847
1848
*/
1848
1849
if (PhysicsEnvelope.isVerticallyConstricted(from, to, pData) && hDistanceAboveLimit > 0.0) {
1850
+
tags.add("vert_constricted");
1849
1851
double[] res = prepareSpeedEstimation(from, to, pData, player, data, thisMove, lastMove, fromOnGround, toOnGround, debug, isNormalOrPacketSplitMove, false, true);
@@ -104,9 +103,8 @@ public static boolean hasAnyUsingItemMethod() {
104
103
* Test if the player's horizontal impulse (WASD presses) is either known or emulated by ViaVersion.
105
104
*
106
105
* @param player The player whose input is being checked.
107
-
* @return <b>Always</b><code>true</code>, if both client and server are on a version that supports impulse sending and reading respectively (1.21.2 and above).<br>
108
-
* <b>Always</b><code>false</code>, if the server is unable to read inputs at all (legacy, pre 1.21.2). <br>
109
-
* <b>Note</b>: currently, we cannot rely on ViaVersion's input emulation for older clients on newer servers (1.21.2+); it seems to be way off from the actual input.
106
+
* @return True if both client and server are on a version that supports impulse reading and sending respectively (1.21.2 and above).<br>
107
+
* Always false, if the server or the client is unable to read inputs at all (legacy, pre 1.21.2). <br>
110
108
* <hr>
111
109
* Check {@link BridgeMisc#isSpaceBarImpulseKnown(Player)} for the vertical impulse.
112
110
*
@@ -117,43 +115,24 @@ public static boolean isWASDImpulseKnown(final Player player) {
117
115
// TODO: What about modern clients (1.21.2+) on legacy servers (1.21.2-)? Is there a way to intercept and translate the sent input by ourselves?
118
116
returnfalse;
119
117
}
120
-
if (DataManager.getPlayerData(player).getClientVersion().isAtLeast(ClientVersion.V_1_21_2)) {
121
-
// Client sends impulses and server can read them. Inputs are always known, regardless of any other condition.
* Test if the player's vertical impulse (space bar presses) is either known or emulated by ViaVersion.
135
124
*
136
125
* @param player The player whose input is being checked.
137
-
* @return <b>Always</b> <code>true</code> if both client and server are on a version that supports impulse reading and sending respectively (1.21.2 and above).<br>
138
-
* <b>Always</b> <code>false</code>, if the server is unable to read inputs at all (legacy, pre 1.21.2). <br>
139
-
* <code>true</code>, if the server supports impulse reading, but the client does not natively support impulse-sending, which is instead enabled by ViaVersion
140
-
* through emulation of the PLAYER_INPUT packet. Because the packet is emulated, the actual impulse may not always reflect what the player actually pressed; particularly if the
141
-
* player's speed was affected by external velocity sources. In which case, this will return <code>false</code>.
126
+
* @return True if both client and server are on a version that supports impulse reading and sending respectively (1.21.2 and above).<br>
127
+
* Always false, if the server or the client is unable to read inputs at all (legacy, pre 1.21.2). <br>
142
128
* <hr>
143
129
* Check {@link BridgeMisc#isWASDImpulseKnown(Player)} for the horizontal impulse.
0 commit comments