mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-06-26 06:14:42 +02:00
Let's have different climb speed thresholds for ascend and descend.
Configurability ... later.
This commit is contained in:
parent
c9efd7b76c
commit
99df1f65da
|
@ -63,7 +63,9 @@ public class Magic {
|
|||
public static final double GLIDE_HORIZONTAL_GAIN_MAX = GRAVITY_MAX / 2.0;
|
||||
|
||||
// Vertical speeds/modifiers.
|
||||
public static final double climbSpeed = WALK_SPEED * 1.3; // TODO: Check if the factor is needed!
|
||||
public static final double climbSpeedAscend = 0.119;
|
||||
public static final double climbSpeedDescend = 0.151;
|
||||
|
||||
/**
|
||||
* Some kind of minimum y descend speed (note the negative sign), for an
|
||||
* already advanced gliding/falling phase with elytra.
|
||||
|
|
|
@ -1677,15 +1677,16 @@ public class SurvivalFly extends Check {
|
|||
final double jumpHeight = 1.35 + (data.jumpAmplifier > 0 ? (0.6 + data.jumpAmplifier - 1.0) : 0.0);
|
||||
// TODO: ladders are ground !
|
||||
// TODO: yDistance < 0.0 ?
|
||||
if (Math.abs(yDistance) > Magic.climbSpeed) {
|
||||
final double maxSpeed = yDistance < 0.0 ? Magic.climbSpeedDescend : Magic.climbSpeedAscend;
|
||||
if (Math.abs(yDistance) > maxSpeed) {
|
||||
if (from.isOnGround(jumpHeight, 0D, 0D, BlockProperties.F_CLIMBABLE)) {
|
||||
if (yDistance > data.liftOffEnvelope.getMaxJumpGain(data.jumpAmplifier)+ 0.1) {
|
||||
tags.add("climbstep");
|
||||
vDistanceAboveLimit = Math.max(vDistanceAboveLimit, Math.abs(yDistance) - Magic.climbSpeed);
|
||||
vDistanceAboveLimit = Math.max(vDistanceAboveLimit, Math.abs(yDistance) - maxSpeed);
|
||||
}
|
||||
} else {
|
||||
tags.add("climbspeed");
|
||||
vDistanceAboveLimit = Math.max(vDistanceAboveLimit, Math.abs(yDistance) - Magic.climbSpeed);
|
||||
vDistanceAboveLimit = Math.max(vDistanceAboveLimit, Math.abs(yDistance) - maxSpeed);
|
||||
}
|
||||
}
|
||||
if (yDistance > 0) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user