Skip to content
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 @@ -163,8 +163,11 @@ public class ElytraFly extends Module {

public final Setting<Double> pitch40lowerBounds = sgGeneral.add(new DoubleSetting.Builder()
.name("pitch40-lower-bounds")
.description("The bottom height boundary for pitch40.")
.defaultValue(80)
.description(
"The bottom height boundary for pitch40. You must be at least 40 blocks above this boundary when starting the module.\n" +
"After descending below this boundary you will start pitching upwards."
)
.defaultValue(180)
.min(-128)
.sliderMax(360)
.visible(() -> flightMode.get() == ElytraFlightModes.Pitch40)
Expand All @@ -173,24 +176,37 @@ public class ElytraFly extends Module {

public final Setting<Double> pitch40upperBounds = sgGeneral.add(new DoubleSetting.Builder()
.name("pitch40-upper-bounds")
.description("The upper height boundary for pitch40.")
.defaultValue(120)
.description(
"The upper height boundary for pitch40. You must be above this boundary when starting the module.\n" +
"When ascending above this boundary, if you are not already, you will start pitching downwards."
)
.defaultValue(220)
.min(-128)
.sliderMax(360)
.visible(() -> flightMode.get() == ElytraFlightModes.Pitch40)
.build()
);

public final Setting<Double> pitch40rotationSpeed = sgGeneral.add(new DoubleSetting.Builder()
.name("pitch40-rotate-speed")
.description("The speed for pitch rotation (degrees per tick)")
.defaultValue(15)
public final Setting<Double> pitch40rotationSpeedUp = sgGeneral.add(new DoubleSetting.Builder()
.name("pitch40-rotate-speed-up")
.description("The speed for pitch rotation upwards (degrees per tick).")
.defaultValue(5.45)
.min(1)
.sliderMax(20)
.visible(() -> flightMode.get() == ElytraFlightModes.Pitch40)
.build()
);

public final Setting<Double> pitch40rotationSpeedDown = sgGeneral.add(new DoubleSetting.Builder()
.name("pitch40-rotate-speed-down")
.description("The speed for pitch rotation downwards (degrees per tick).")
.defaultValue(0.90)
.min(0.5)
.sliderMax(2)
.visible(() -> flightMode.get() == ElytraFlightModes.Pitch40)
.build()
);

public final Setting<Boolean> autoJump = sgGeneral.add(new BoolSetting.Builder()
.name("auto-jump")
.description("Automatically jumps for you.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void onActivate() {
elytraFly.toggle();
}

pitch = 32.0F;
pitch = 37.72F;
}

/**
Expand All @@ -45,8 +45,8 @@ public void onTick() {
super.onTick();

/*
When descending, look at 32-33 deg
When ascending, look up at -49 at 10*pitch speed, then lower at 0.5 deg/tick until at 32-33
When descending, look at 37.72 deg
When ascending, look up at -54.77 at 5.45 degree/tick, then lower at 0.90 deg/tick until at 37.72
*/

if (pitchingDown && mc.player.getY() <= elytraFly.pitch40lowerBounds.get()) {
Expand All @@ -58,15 +58,15 @@ else if (!pitchingDown && mc.player.getY() >= elytraFly.pitch40upperBounds.get()

// Pitch upwards
if (!pitchingDown) {
pitch -= randPitch(elytraFly.pitch40rotationSpeed.get().floatValue(), 3.0F);
pitch -= randPitch(elytraFly.pitch40rotationSpeedUp.get().floatValue(), 1.0F);

if (pitch < -49.0) {
pitch = -49.0F;
if (pitch < -54.77F) {
pitch = -54.77F;
pitchingDown = true;
}
// Pitch downwards
} else if (pitch < 32.0) {
pitch += randPitch(0.5F, 0.125F);
} else if (pitch < 37.72F) {
pitch += randPitch(elytraFly.pitch40rotationSpeedDown.get().floatValue(), 0.50F);
}

mc.player.setPitch(pitch);
Expand Down