diff options
author | alemi <me@alemi.dev> | 2023-06-21 00:10:37 +0200 |
---|---|---|
committer | alemi <me@alemi.dev> | 2023-06-21 00:15:07 +0200 |
commit | bf5405d64df9da5c3143a3216e04c2e909f329ae (patch) | |
tree | 0a4093486ce7f21292b710ac9cc21fd62fe25e3b /src/main/java | |
parent | 134d6fedaa778cd8454dae867efbaa7ddbd9b4ee (diff) |
feat: allow disabling drift in vanillaflight
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/ftbsc/bscv/modules/motion/VanillaFlight.java | 12 |
1 files changed, 12 insertions, 0 deletions
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<Boolean> force; + public final ForgeConfigSpec.ConfigValue<Boolean> drift; public final ForgeConfigSpec.ConfigValue<Double> speed; public final ForgeConfigSpec.ConfigValue<AntikickMode> antikick; public final ForgeConfigSpec.ConfigValue<Double> 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(); |