diff --git a/src/main/java/ftbsc/bscv/modules/motion/VanillaFlight.java b/src/main/java/ftbsc/bscv/modules/motion/VanillaFlight.java index 150fdb1..df00eda 100644 --- a/src/main/java/ftbsc/bscv/modules/motion/VanillaFlight.java +++ b/src/main/java/ftbsc/bscv/modules/motion/VanillaFlight.java @@ -4,6 +4,7 @@ import com.google.auto.service.AutoService; import ftbsc.bscv.api.ILoadable; import ftbsc.bscv.modules.QuickModule; import ftbsc.bscv.patches.PacketPatch.PacketEvent; +import ftbsc.bscv.tools.Keyboard; import ftbsc.bscv.tools.Setting; import net.minecraft.network.play.client.CPlayerPacket; import net.minecraft.util.math.vector.Vector3d; @@ -24,6 +25,7 @@ public class VanillaFlight extends QuickModule { private static final int MS_PER_TICK = 50; public final ForgeConfigSpec.ConfigValue force; + public final ForgeConfigSpec.ConfigValue drift; public final ForgeConfigSpec.ConfigValue speed; public final ForgeConfigSpec.ConfigValue antikick; public final ForgeConfigSpec.ConfigValue antikick_magnitude; @@ -41,6 +43,12 @@ public class VanillaFlight extends QuickModule { .fallback(false) .build(this); + this.drift = Setting.Bool.builder() + .name("drift") + .comment("gradually reduce momentum") + .fallback(true) + .build(this); + this.speed = Setting.Decimal.builder() .min(0.) .fallback(0.05) @@ -101,6 +109,10 @@ public class VanillaFlight extends QuickModule { MC.player.abilities.flying = true; } + if (!this.drift.get() && !Keyboard.isMoving()) { + MC.player.setDeltaMovement(Vector3d.ZERO); + } + this.tick = ( this.tick + 1 ) % this.antikick_cycle.get(); Vector3d pos = MC.player.position();