mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-12-27 02:48:04 +01:00
Attempt to fix issues with re-join and survivalfly.
This commit is contained in:
parent
d42f94f651
commit
a22b259cc4
@ -1121,16 +1121,25 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
data.clearMorePacketsData();
|
||||
final Location loc = player.getLocation();
|
||||
|
||||
// TODO: shouldCheckSurvivalFly ?
|
||||
|
||||
// Correct set-back on world changes.
|
||||
if (!data.hasSetBack() || data.hasSetBackWorldChanged(loc)){
|
||||
if (!data.hasSetBack()){
|
||||
data.setSetBack(loc);
|
||||
}
|
||||
else if (data.hasSetBackWorldChanged(loc)){
|
||||
data.setSetBack(loc);
|
||||
data.clearFlyData();
|
||||
}
|
||||
if (data.fromX == Double.MAX_VALUE && data.toX == Double.MAX_VALUE){
|
||||
// TODO: re-think: more fine grained reset?
|
||||
data.resetPositions(loc);
|
||||
}
|
||||
|
||||
// More resetting.
|
||||
data.vDistAcc.clear();
|
||||
data.toWasReset = false;
|
||||
data.fromWasReset = false;
|
||||
|
||||
// Hover.
|
||||
final MovingConfig cc = MovingConfig.getConfig(player);
|
||||
// Reset hover ticks until a better method is used.
|
||||
if (cc.sfHoverCheck){
|
||||
|
@ -316,10 +316,19 @@ public class SurvivalFly extends Check {
|
||||
// TODO: consider tags for jumping as well (!).
|
||||
if (data.sfJumpPhase > maxJumpPhase && data.verticalVelocityCounter <= 0){
|
||||
// Could use dirty flag here !
|
||||
boolean useDist = data.sfDirty || yDistance < 0 || resetFrom;
|
||||
if (useDist){
|
||||
// TODO: (This allows the one tick longer jump (resetTo)).
|
||||
vAllowedDistance -= Math.max(0, (data.sfJumpPhase - maxJumpPhase) * 0.15D);
|
||||
if (data.sfDirty || yDistance < 0 || resetFrom){
|
||||
if (data.getSetBackY() > to.getY()){
|
||||
if (data.sfJumpPhase > 2 * maxJumpPhase){
|
||||
// Ignore it for falling.
|
||||
}
|
||||
else{
|
||||
vAllowedDistance -= Math.max(0, (data.sfJumpPhase - maxJumpPhase) * 0.15D);
|
||||
}
|
||||
}
|
||||
else{
|
||||
// TODO: (This allows the one tick longer jump (resetTo)).
|
||||
vAllowedDistance -= Math.max(0, (data.sfJumpPhase - maxJumpPhase) * 0.15D);
|
||||
}
|
||||
}
|
||||
else if (!data.sfDirty){
|
||||
// Violation (Too high jumping or step).
|
||||
|
@ -423,7 +423,7 @@ public class DefaultConfig extends ConfigFile {
|
||||
// sf / hover check.
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_CHECK, true);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_STEP, 5);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_TICKS, 80);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_TICKS, 85);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_LOGINTICKS, 0);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_FALLDAMAGE, true);
|
||||
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_SFVIOLATION, 500);
|
||||
|
Loading…
Reference in New Issue
Block a user