mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-27 14:13:11 +02:00
[BLEEDING] Elytra boost: Who tested the other version!?
This commit is contained in:
parent
c2449ac08a
commit
72b454bbab
@ -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) {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user