diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/blockinteract/BlockInteractListener.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/blockinteract/BlockInteractListener.java index 6a8b31fa..4f14990c 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/blockinteract/BlockInteractListener.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/blockinteract/BlockInteractListener.java @@ -31,7 +31,6 @@ import fr.neatmonster.nocheatplus.checks.CheckListener; import fr.neatmonster.nocheatplus.checks.CheckType; import fr.neatmonster.nocheatplus.checks.combined.CombinedConfig; import fr.neatmonster.nocheatplus.checks.moving.MovingData; -import fr.neatmonster.nocheatplus.checks.moving.magic.Magic; import fr.neatmonster.nocheatplus.compat.Bridge1_9; import fr.neatmonster.nocheatplus.compat.BridgeHealth; import fr.neatmonster.nocheatplus.compat.BridgeMisc; @@ -210,18 +209,11 @@ public class BlockInteractListener extends CheckListener { if (stack != null && BridgeMisc.maybeElytraBoost(player, stack.getType())) { final BlockInteractData data = BlockInteractData.getData(player); final int power = BridgeMisc.getFireworksPower(stack); - /* - * The default Material.FIREWORK has power 0 and roughly does 10 - * blocks in one seconds. With power 127, the flight duration - * roughly is 7 seconds, so we assume the effect duration to be - * something like 20 + power. What does the wiki tell? However - * the actual flight duration with elytra + fireworks seems to - * be higher, or the friction behavior has changed. - */ final MovingData mData = MovingData.getData(player); - mData.fireworksBoostDuration = power + Magic.FIREWORKS_BOOST_EXTRA_TICKS; + final int ticks = Math.max((1 + power) * 20, 30); + mData.fireworksBoostDuration = ticks; // Expiration tick: not general latency, rather a minimum margin for sudden congestion. - mData.fireworksBoostTickExpire = TickTask.getTick() + power + Magic.FIREWORKS_BOOST_EXTRA_TICKS; + mData.fireworksBoostTickExpire = TickTask.getTick() + ticks; // TODO: Invalidation mechanics: by tick/time well ? // TODO: Implement using it in CreativeFly. if (data.debug) { diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/magic/Magic.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/magic/Magic.java index f26a8832..f441e195 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/magic/Magic.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/magic/Magic.java @@ -82,7 +82,6 @@ public class Magic { * moving direction). */ public static final double GLIDE_DESCEND_GAIN_MAX_POS = GRAVITY_ODD / 1.95; - public static final int FIREWORKS_BOOST_EXTRA_TICKS = 50; // On-ground. public static final double Y_ON_GROUND_MIN = 0.00001;