Another special case bunny (@Iceee).

This commit is contained in:
asofold 2015-09-07 00:23:45 +02:00
parent 30abbe0225
commit f2f66c1572
2 changed files with 9 additions and 1 deletions

View File

@ -195,6 +195,8 @@ public class MovingData extends ACheckData {
*/ */
public double sfLastYDist = Double.MAX_VALUE; public double sfLastYDist = Double.MAX_VALUE;
public double sfLastHDist = Double.MAX_VALUE; public double sfLastHDist = Double.MAX_VALUE;
public boolean sfLastAllowBunny = false;
public boolean sfThisAllowBunny = false;
/** Counting while the player is not on ground and not moving. A value <0 means not hovering at all. */ /** Counting while the player is not on ground and not moving. A value <0 means not hovering at all. */
public int sfHoverTicks = -1; public int sfHoverTicks = -1;
/** First count these down before incrementing sfHoverTicks. Set on join, if configured so. */ /** First count these down before incrementing sfHoverTicks. Set on join, if configured so. */
@ -252,6 +254,7 @@ public class MovingData extends ACheckData {
mediumLiftOff = defaultMediumLiftOff; mediumLiftOff = defaultMediumLiftOff;
vehicleConsistency = MoveConsistency.INCONSISTENT; vehicleConsistency = MoveConsistency.INCONSISTENT;
lastFrictionHorizontal = lastFrictionVertical = 0.0; lastFrictionHorizontal = lastFrictionVertical = 0.0;
sfLastAllowBunny = sfThisAllowBunny = false;
} }
/** /**
@ -285,6 +288,7 @@ public class MovingData extends ACheckData {
removeAllVelocity(); removeAllVelocity();
vehicleConsistency = MoveConsistency.INCONSISTENT; // Not entirely sure here. vehicleConsistency = MoveConsistency.INCONSISTENT; // Not entirely sure here.
lastFrictionHorizontal = lastFrictionVertical = 0.0; lastFrictionHorizontal = lastFrictionVertical = 0.0;
sfLastAllowBunny = sfThisAllowBunny = false;
} }
/** /**

View File

@ -551,6 +551,8 @@ public class SurvivalFly extends Check {
data.fromWasReset = resetFrom || data.noFallAssumeGround; data.fromWasReset = resetFrom || data.noFallAssumeGround;
data.lastFrictionHorizontal = data.nextFrictionHorizontal; data.lastFrictionHorizontal = data.nextFrictionHorizontal;
data.lastFrictionVertical = data.nextFrictionVertical; data.lastFrictionVertical = data.nextFrictionVertical;
data.sfLastAllowBunny = data.sfThisAllowBunny;
data.sfThisAllowBunny = false;
if (data.debug && tags.size() > tagsLength) { if (data.debug && tags.size() > tagsLength) {
logPostViolationTags(player); logPostViolationTags(player);
} }
@ -1088,7 +1090,8 @@ public class SurvivalFly extends Check {
// TODO: Test bunny spike over all sorts of speeds + attributes. // TODO: Test bunny spike over all sorts of speeds + attributes.
// TODO: Allow slightly higher speed on lost ground? // TODO: Allow slightly higher speed on lost ground?
if (data.mediumLiftOff != MediumLiftOff.LIMIT_JUMP // && yDistance >= 0.4 if (data.mediumLiftOff != MediumLiftOff.LIMIT_JUMP // && yDistance >= 0.4
&& (data.sfJumpPhase == 0 && from.isOnGround() || data.sfJumpPhase <= 1 && data.noFallAssumeGround) && (data.sfJumpPhase == 0 && from.isOnGround() || data.sfJumpPhase <= 1 && data.noFallAssumeGround
|| data.sfLastAllowBunny) // TODO: Should probably still confine y-dist to set-back.
&& !from.isResetCond() && !to.isResetCond() && !from.isResetCond() && !to.isResetCond()
|| double_bunny || double_bunny
) { ) {
@ -1335,6 +1338,7 @@ public class SurvivalFly extends Check {
// TODO: confine by block types ? // TODO: confine by block types ?
if (from.isOnGround(0.25, 0.4, 0, 0L) ) { if (from.isOnGround(0.25, 0.4, 0, 0L) ) {
// Temporary "fix". // Temporary "fix".
data.sfThisAllowBunny = true;
return applyLostGround(player, from, true, data, "ministep"); return applyLostGround(player, from, true, data, "ministep");
} }
} }