Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make yaw lock of bounce efly optional and fixed typo #4035

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import meteordevelopment.meteorclient.systems.modules.movement.elytrafly.modes.Bounce;
import meteordevelopment.meteorclient.systems.modules.movement.elytrafly.modes.Vanilla;
import meteordevelopment.meteorclient.systems.modules.player.ChestSwap;
import meteordevelopment.meteorclient.systems.modules.player.Rotation;
import meteordevelopment.meteorclient.systems.modules.render.Freecam;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.block.Block;
Expand Down Expand Up @@ -196,16 +197,34 @@ public class ElytraFly extends Module {
.build()
);

public final Setting<Rotation.LockMode> yawLockMode = sgGeneral.add(new EnumSetting.Builder<Rotation.LockMode>()
.name("yaw-lock")
.description("Whether to enable yaw lock or not")
.defaultValue(Rotation.LockMode.Smart)
.visible(() -> flightMode.get() == ElytraFlightModes.Bounce)
.build()
);

public final Setting<Double> pitch = sgGeneral.add(new DoubleSetting.Builder()
.name("pitch")
.description("The pitch angle to look at when using the recast mode.")
.description("The pitch angle to look at when using the bounce mode.")
.defaultValue(85)
.range(0, 90)
.sliderRange(0, 90)
.visible(() -> flightMode.get() == ElytraFlightModes.Bounce)
.build()
);

public final Setting<Double> yaw = sgGeneral.add(new DoubleSetting.Builder()
.name("yaw")
.description("The yaw angle to look at when using simple rotation lock in bounce mode.")
.defaultValue(0)
.range(0, 360)
.sliderRange(0,360)
.visible(() -> flightMode.get() == ElytraFlightModes.Bounce && yawLockMode.get() == Rotation.LockMode.Simple)
.build()
);

public final Setting<Boolean> restart = sgGeneral.add(new BoolSetting.Builder()
.name("restart")
.description("Restarts flying with the elytra when rubberbanding.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import meteordevelopment.meteorclient.events.packets.PacketEvent;
import meteordevelopment.meteorclient.systems.modules.movement.elytrafly.ElytraFlightMode;
import meteordevelopment.meteorclient.systems.modules.movement.elytrafly.ElytraFlightModes;
import meteordevelopment.meteorclient.systems.modules.player.Rotation;
import meteordevelopment.meteorclient.utils.misc.input.Input;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.option.KeyBinding;
Expand Down Expand Up @@ -47,7 +48,7 @@ public void onTick() {
if (prevFov != 0 && !elytraFly.sprint.get()) mc.options.getFovEffectScale().setValue(0.0); // This stops the FOV effects from constantly going on and off.
if (elytraFly.autoJump.get()) setPressed(mc.options.jumpKey, true);
setPressed(mc.options.forwardKey, true);
mc.player.setYaw(getSmartYawDirection());
mc.player.setYaw(getYawDirection());
mc.player.setPitch(elytraFly.pitch.get().floatValue());
}

Expand Down Expand Up @@ -125,8 +126,13 @@ private static boolean ignoreGround(ClientPlayerEntity player) {
} else return false;
}

private float getSmartYawDirection() {
return Math.round((mc.player.getYaw() + 1f) / 45f) * 45f;
private float getYawDirection() {
return switch (elytraFly.yawLockMode.get()) {
case None -> mc.player.getYaw();
case Smart -> Math.round((mc.player.getYaw() + 1f) / 45f) * 45f;
case Simple -> elytraFly.yaw.get().floatValue();
};

}

@Override
Expand Down