ElytraFly: AutoStart fixes

This commit is contained in:
noil 2021-03-06 09:19:35 -05:00
parent cf0404aaf2
commit d11c80ced3
1 changed files with 12 additions and 6 deletions

View File

@ -44,7 +44,7 @@ public final class ElytraFlyModule extends Module {
public final Value<Float> speedZ = new Value<Float>("SpeedZ", new String[]{"SpdZ", "amountZ", "sZ"}, "The Z speed factor (speed * this).", 1.0f, 0.1f, 5.0f, 0.1f);
public final Value<Boolean> autoStart = new Value<Boolean>("AutoStart", new String[]{"AutoStart", "Auto-Start", "start", "autojump", "as"}, "Hold down the jump key to have an easy automated lift off.", true);
public final Value<Float> autoStartDelay = new Value<Float>("StartDelay", new String[]{"AutoStartDelay", "startdelay", "autojumpdelay", "asd"}, "Delay(ms) between auto-start attempts.", 20.0f, 0.0f, 200.0f, 5.0f);
public final Value<Float> autoStartDelay = new Value<Float>("StartDelay", new String[]{"AutoStartDelay", "startdelay", "autojumpdelay", "asd"}, "Delay(ms) between auto-start attempts.", 100.0f, 0.0f, 300.0f, 10.0f);
public final Value<Boolean> autoEquip = new Value<Boolean>("AutoEquip", new String[]{"AutoEquipt", "AutoElytra", "Equip", "Equipt", "ae"}, "Automatically equips a durable elytra before or during flight. (inventory only, not hotbar!)", false);
public final Value<Float> autoEquipDelay = new Value<Float>("EquipDelay", new String[]{"AutoEquipDelay", "AutoEquiptDelay", "equipdelay", "aed"}, "Delay(ms) between elytra equip swap attempts.", 200.0f, 0.0f, 1000.0f, 10.0f);
public final Value<Boolean> stayAirborne = new Value<Boolean>("StayAirborne", new String[]{"Airborne", "StayInAir", "Stay-Airborne", "air", "sa"}, "Attempts to always keep the player airborne (only use when AutoEquip is enabled).", false);
@ -158,11 +158,17 @@ public final class ElytraFlyModule extends Module {
// automatic jump start
if (this.autoStart.getValue()) {
if (mc.gameSettings.keyBindJump.isKeyDown() && !mc.player.isElytraFlying()) { // jump is held, player is not elytra flying
if (mc.player.motionY < 0) { // player motion is falling
if (this.startDelayTimer.passed(this.autoStartDelay.getValue())) {
mc.player.connection.sendPacket(new CPacketEntityAction(mc.player, CPacketEntityAction.Action.START_FALL_FLYING));
this.startDelayTimer.reset();
if (!mc.player.isElytraFlying()) {
if (mc.player.onGround) {
this.startDelayTimer.reset();
}
if (mc.gameSettings.keyBindJump.isKeyDown()) { // jump is held, player is not elytra flying
if (mc.player.motionY < 0) { // player motion is falling
if (this.startDelayTimer.passed(this.autoStartDelay.getValue())) {
mc.player.connection.sendPacket(new CPacketEntityAction(mc.player, CPacketEntityAction.Action.START_FALL_FLYING));
this.startDelayTimer.reset();
}
}
}
}