mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-07 00:08:20 +01:00
Bleeding: Adjust velocity handling for survivalfly.
This commit is contained in:
parent
26d47cd0f2
commit
aecf3a6f1f
@ -341,7 +341,7 @@ public class MovingListener implements Listener {
|
|||||||
data.verticalVelocityCounter--;
|
data.verticalVelocityCounter--;
|
||||||
if (data.verticalVelocityCounter > 0D) {
|
if (data.verticalVelocityCounter > 0D) {
|
||||||
data.verticalFreedom += data.verticalVelocity;
|
data.verticalFreedom += data.verticalVelocity;
|
||||||
data.verticalVelocity *= 0.90D;
|
data.verticalVelocity *= 0.93D;
|
||||||
} else if (data.verticalFreedom > 0.001D)
|
} else if (data.verticalFreedom > 0.001D)
|
||||||
// Counter has run out, now reduce the vertical freedom over time.
|
// Counter has run out, now reduce the vertical freedom over time.
|
||||||
data.verticalFreedom *= 0.93D;
|
data.verticalFreedom *= 0.93D;
|
||||||
|
@ -209,6 +209,7 @@ public class SurvivalFly extends Check {
|
|||||||
if (!fromOnGround
|
if (!fromOnGround
|
||||||
&& (from.getY() < data.survivalFlyLastFromY && yDistance > 0D && yDistance < 0.5D
|
&& (from.getY() < data.survivalFlyLastFromY && yDistance > 0D && yDistance < 0.5D
|
||||||
&& setBackYDistance > 0D && setBackYDistance <= 1.5D || !toOnGround && to.isAboveStairs())) {
|
&& setBackYDistance > 0D && setBackYDistance <= 1.5D || !toOnGround && to.isAboveStairs())) {
|
||||||
|
// System.out.println("*** reset setback.");
|
||||||
// Set the new setBack and reset the jumpPhase.
|
// Set the new setBack and reset the jumpPhase.
|
||||||
data.setBack = from.getLocation();
|
data.setBack = from.getLocation();
|
||||||
data.setBack.setY(Math.floor(data.setBack.getY()));
|
data.setBack.setY(Math.floor(data.setBack.getY()));
|
||||||
@ -230,11 +231,15 @@ public class SurvivalFly extends Check {
|
|||||||
else{
|
else{
|
||||||
vAllowedDistance = (!fromOnGround && !toOnGround ? 1.45D : 1.35D) + data.verticalFreedom;
|
vAllowedDistance = (!fromOnGround && !toOnGround ? 1.45D : 1.35D) + data.verticalFreedom;
|
||||||
vAllowedDistance *= data.jumpAmplifier;
|
vAllowedDistance *= data.jumpAmplifier;
|
||||||
if (data.survivalFlyJumpPhase > 6 + data.jumpAmplifier)
|
if (data.survivalFlyJumpPhase > 6 + data.jumpAmplifier && data.verticalVelocityCounter <= 0){
|
||||||
vAllowedDistance -= (data.survivalFlyJumpPhase - 6) * 0.15D;
|
vAllowedDistance -= (data.survivalFlyJumpPhase - 6) * 0.15D;
|
||||||
|
// System.out.println("jumpphase -> " + data.survivalFlyJumpPhase);
|
||||||
|
}
|
||||||
|
|
||||||
vDistanceAboveLimit = to.getY() - data.setBack.getY() - vAllowedDistance;
|
vDistanceAboveLimit = to.getY() - data.setBack.getY() - vAllowedDistance;
|
||||||
|
|
||||||
|
// System.out.println("vda = " +vDistanceAboveLimit + " / vc = " + data.verticalVelocityCounter + " / vf = " + data.verticalFreedom + " / v = " + player.getVelocity().length());
|
||||||
|
|
||||||
// Step can also be blocked.
|
// Step can also be blocked.
|
||||||
if (fromOnGround && toOnGround && Math.abs(to.getY() - from.getY() - 1D) <= cc.yStep && vDistanceAboveLimit <= 0D
|
if (fromOnGround && toOnGround && Math.abs(to.getY() - from.getY() - 1D) <= cc.yStep && vDistanceAboveLimit <= 0D
|
||||||
&& !player.hasPermission(Permissions.MOVING_SURVIVALFLY_STEP))
|
&& !player.hasPermission(Permissions.MOVING_SURVIVALFLY_STEP))
|
||||||
|
Loading…
Reference in New Issue
Block a user