Attempt to fix issues with re-join and survivalfly.

This commit is contained in:
asofold 2013-03-03 18:44:37 +01:00
parent d42f94f651
commit a22b259cc4
3 changed files with 26 additions and 8 deletions

View File

@ -1121,16 +1121,25 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
data.clearMorePacketsData(); data.clearMorePacketsData();
final Location loc = player.getLocation(); final Location loc = player.getLocation();
// TODO: shouldCheckSurvivalFly ?
// Correct set-back on world changes. // Correct set-back on world changes.
if (!data.hasSetBack() || data.hasSetBackWorldChanged(loc)){ if (!data.hasSetBack()){
data.setSetBack(loc); data.setSetBack(loc);
} }
else if (data.hasSetBackWorldChanged(loc)){
data.setSetBack(loc);
data.clearFlyData();
}
if (data.fromX == Double.MAX_VALUE && data.toX == Double.MAX_VALUE){ if (data.fromX == Double.MAX_VALUE && data.toX == Double.MAX_VALUE){
// TODO: re-think: more fine grained reset? // TODO: re-think: more fine grained reset?
data.resetPositions(loc); data.resetPositions(loc);
} }
// More resetting.
data.vDistAcc.clear();
data.toWasReset = false;
data.fromWasReset = false;
// Hover.
final MovingConfig cc = MovingConfig.getConfig(player); final MovingConfig cc = MovingConfig.getConfig(player);
// Reset hover ticks until a better method is used. // Reset hover ticks until a better method is used.
if (cc.sfHoverCheck){ if (cc.sfHoverCheck){

View File

@ -316,11 +316,20 @@ public class SurvivalFly extends Check {
// TODO: consider tags for jumping as well (!). // TODO: consider tags for jumping as well (!).
if (data.sfJumpPhase > maxJumpPhase && data.verticalVelocityCounter <= 0){ if (data.sfJumpPhase > maxJumpPhase && data.verticalVelocityCounter <= 0){
// Could use dirty flag here ! // Could use dirty flag here !
boolean useDist = data.sfDirty || yDistance < 0 || resetFrom; if (data.sfDirty || yDistance < 0 || resetFrom){
if (useDist){ 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)). // TODO: (This allows the one tick longer jump (resetTo)).
vAllowedDistance -= Math.max(0, (data.sfJumpPhase - maxJumpPhase) * 0.15D); vAllowedDistance -= Math.max(0, (data.sfJumpPhase - maxJumpPhase) * 0.15D);
} }
}
else if (!data.sfDirty){ else if (!data.sfDirty){
// Violation (Too high jumping or step). // Violation (Too high jumping or step).
tags.add("maxphase"); tags.add("maxphase");

View File

@ -423,7 +423,7 @@ public class DefaultConfig extends ConfigFile {
// sf / hover check. // sf / hover check.
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_CHECK, true); set(ConfPaths.MOVING_SURVIVALFLY_HOVER_CHECK, true);
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_STEP, 5); 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_LOGINTICKS, 0);
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_FALLDAMAGE, true); set(ConfPaths.MOVING_SURVIVALFLY_HOVER_FALLDAMAGE, true);
set(ConfPaths.MOVING_SURVIVALFLY_HOVER_SFVIOLATION, 500); set(ConfPaths.MOVING_SURVIVALFLY_HOVER_SFVIOLATION, 500);