Skip to content

Added height option to AutoLog #5382

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 @@ -73,6 +73,22 @@ public class AutoLog extends Module {
.defaultValue(false)
.build()
);

private final Setting<Boolean> height = sgGeneral.add(new BoolSetting.Builder()
.name("height")
.description("Disconnects when player's height is lower than certain threshold.")
.defaultValue(false)
.build()
);

private final Setting<Integer> heightThreshold = sgGeneral.add(new IntSetting.Builder()
.name("height-threshold")
.description("The minimum height that is required to stay logged in.")
.defaultValue(0)
.sliderRange(-64, 320)
.visible(() -> height.get())
.build()
);

private final Setting<Boolean> smartToggle = sgGeneral.add(new BoolSetting.Builder()
.name("smart-toggle")
Expand Down Expand Up @@ -191,6 +207,12 @@ private void onTick(TickEvent.Post event) {
if (toggleOff.get()) this.toggle();
return;
}

if (height.get() && mc.player.getY() < heightThreshold.get()){
disconnect("Height was lower than " + heightThreshold.get() + ".");
if (toggleOff.get()) this.toggle();
return;
}

if (!onlyTrusted.get() && !instantDeath.get() && entities.get().isEmpty())
return; // only check all entities if needed
Expand Down