Skip to content
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