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,13 @@ public class AutoEat extends Module {
.build()
);

private final Setting<Boolean> pauseAutoFish = sgGeneral.add(new BoolSetting.Builder()
.name("pause-autofish")
.description("Pause AutoFish when eating.")
.defaultValue(true)
.build()
);

private final Setting<Boolean> searchInventory = sgGeneral.add(new BoolSetting.Builder()
.name("search-inventory")
.description("Search the full inventory for food, not only the hotbar.")
Expand Down Expand Up @@ -121,6 +128,7 @@ public class AutoEat extends Module {

private final List<Class<? extends Module>> wasAura = new ReferenceArrayList<>();
private boolean wasBaritone = false;
private boolean wasAutoFish = false;

public AutoEat() {
super(Categories.Player, "auto-eat", "Automatically eats food.");
Expand Down Expand Up @@ -200,6 +208,15 @@ private void startEating() {
wasBaritone = true;
PathManagers.get().pause();
}

// Pause autofish
if (pauseAutoFish.get()) {
Module autoFish = Modules.get().get(AutoFish.class);
if (autoFish != null && autoFish.isActive()) {
wasAutoFish = true;
autoFish.toggle();
}
}
}

private void eat() {
Expand Down Expand Up @@ -230,6 +247,15 @@ private void stopEating() {
wasBaritone = false;
PathManagers.get().resume();
}

// Resume autofish
if (pauseAutoFish.get() && wasAutoFish) {
wasAutoFish = false;
Module autoFish = Modules.get().get(AutoFish.class);
if (autoFish != null) {
autoFish.enable();
}
}
}

private void setPressed(boolean pressed) {
Expand Down
Loading