Update SurvivalFly.java (1.13 swimming - Dolphins Grace)

Allows for better transition between underwater to above water while Dolphins Grace effect is applied
This commit is contained in:
CaptainObvious0 2019-03-01 19:36:51 -06:00 committed by GitHub
parent fc2eb90e8b
commit 7fbcb945a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -1582,12 +1582,17 @@ public class SurvivalFly extends Check {
hDistanceAboveLimit = bunnyHop(from, to, hAllowedDistance, hDistanceAboveLimit, sprinting, thisMove, lastMove, data, cc);
// After failure permission checks ( + speed modifier + sneaking + blocking + speeding) and velocity (!).
if (hDistanceAboveLimit > 0.0 && !skipPermChecks) {
if (hDistanceAboveLimit > 0.12 && !skipPermChecks && !thisMove.from.inLiquid && !thisMove.to.inLiquid && !player.hasPotionEffect(PotionEffectType.DOLPHINS_GRACE)) {
// TODO: Most cases these will not apply. Consider redesign to do these last or checking right away and skip here on some conditions.
hAllowedDistance = setAllowedhDist(player, sprinting, thisMove, data, cc, pData, true);
hDistanceAboveLimit = thisMove.hDistance - hAllowedDistance;
tags.add("permchecks");
tags.add("permchecks-outliq");
}
if (hDistanceAboveLimit > 0.6 && !skipPermChecks && thisMove.from.inLiquid && thisMove.to.inLiquid && player.hasPotionEffect(PotionEffectType.DOLPHINS_GRACE)) {
hAllowedDistance = setAllowedhDist(player, sprinting, thisMove, data, cc, pData, true);
hDistanceAboveLimit = thisMove.hDistance - hAllowedDistance;
tags.add("permchecks-inliq");
}
// Check being moved by blocks.
if (cc.trackBlockMove && hDistanceAboveLimit > 0.0