Skip to content

Commit f18cc80

Browse files
author
Contributor
committed
feat(AutoEat): add pause-autofish setting
1 parent a5f1a11 commit f18cc80

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

  • src/main/java/meteordevelopment/meteorclient/systems/modules/player

‎src/main/java/meteordevelopment/meteorclient/systems/modules/player/AutoEat.java‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ public class AutoEat extends Module {
7373
.build()
7474
);
7575

76+
private final Setting<Boolean> pauseAutoFish = sgGeneral.add(new BoolSetting.Builder()
77+
.name("pause-autofish")
78+
.description("Pause AutoFish when eating.")
79+
.defaultValue(true)
80+
.build()
81+
);
82+
7683
private final Setting<Boolean> searchInventory = sgGeneral.add(new BoolSetting.Builder()
7784
.name("search-inventory")
7885
.description("Search the full inventory for food, not only the hotbar.")
@@ -121,6 +128,7 @@ public class AutoEat extends Module {
121128

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

125133
public AutoEat() {
126134
super(Categories.Player, "auto-eat", "Automatically eats food.");
@@ -200,6 +208,15 @@ private void startEating() {
200208
wasBaritone = true;
201209
PathManagers.get().pause();
202210
}
211+
212+
// Pause autofish
213+
if (pauseAutoFish.get()) {
214+
Module autoFish = Modules.get().get(AutoFish.class);
215+
if (autoFish != null && autoFish.isActive()) {
216+
wasAutoFish = true;
217+
autoFish.toggle();
218+
}
219+
}
203220
}
204221

205222
private void eat() {
@@ -230,6 +247,15 @@ private void stopEating() {
230247
wasBaritone = false;
231248
PathManagers.get().resume();
232249
}
250+
251+
// Resume autofish
252+
if (pauseAutoFish.get() && wasAutoFish) {
253+
wasAutoFish = false;
254+
Module autoFish = Modules.get().get(AutoFish.class);
255+
if (autoFish != null) {
256+
autoFish.enable();
257+
}
258+
}
233259
}
234260

235261
private void setPressed(boolean pressed) {

0 commit comments

Comments
 (0)