From 8b36d86f7092f5a0f7055c09e2fabd11246809f8 Mon Sep 17 00:00:00 2001 From: safder <107740161+safder2000@users.noreply.github.com> Date: Wed, 25 Oct 2023 14:54:17 +0530 Subject: [PATCH 1/3] AutoEat now toggle the InfiniteMine --- .../systems/modules/player/AutoEat.java | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/player/AutoEat.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/player/AutoEat.java index 307854c048..397493098d 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/player/AutoEat.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/player/AutoEat.java @@ -16,6 +16,7 @@ import meteordevelopment.meteorclient.systems.modules.combat.BedAura; import meteordevelopment.meteorclient.systems.modules.combat.CrystalAura; import meteordevelopment.meteorclient.systems.modules.combat.KillAura; +import meteordevelopment.meteorclient.systems.modules.player.AutoEat.ThresholdMode; import meteordevelopment.meteorclient.utils.Utils; import meteordevelopment.meteorclient.utils.player.InvUtils; import meteordevelopment.meteorclient.utils.player.SlotUtils; @@ -30,6 +31,7 @@ public class AutoEat extends Module { private static final Class[] AURAS = new Class[] { KillAura.class, CrystalAura.class, AnchorAura.class, BedAura.class }; + private static final Class[] BARITONE_MODULES = new Class[] { InfinityMiner.class }; private final SettingGroup sgGeneral = settings.getDefaultGroup(); private final SettingGroup sgThreshold = settings.createGroup("Threshold"); @@ -100,7 +102,9 @@ public class AutoEat extends Module { public boolean eating; private int slot, prevSlot; - private final List> wasAura = new ArrayList<>(); + private final List> wasAura = new ArrayList<>(); + private final List> wasBaritoneList = new ArrayList<>(); + private boolean wasBaritone = false; public AutoEat() { @@ -179,9 +183,18 @@ private void startEating() { } // Pause baritone + wasBaritoneList.clear(); if (pauseBaritone.get() && PathManagers.get().isPathing() && !wasBaritone) { wasBaritone = true; PathManagers.get().pause(); + for (Class klass : BARITONE_MODULES) { + Module module = Modules.get().get(klass); + + if (module.isActive()) { + wasBaritoneList.add(klass); + module.toggle(); + } + } } } @@ -209,11 +222,19 @@ private void stopEating() { } } } + // Resume baritone if (pauseBaritone.get() && wasBaritone) { wasBaritone = false; PathManagers.get().resume(); + for (Class klass : BARITONE_MODULES) { + Module module = Modules.get().get(klass); + + if (wasBaritoneList.contains(klass) && !module.isActive()) { + module.toggle(); + } + } } } From 0957050679290716b860f1799d8ecb2b14751de6 Mon Sep 17 00:00:00 2001 From: safder <107740161+safder2000@users.noreply.github.com> Date: Wed, 25 Oct 2023 15:49:47 +0530 Subject: [PATCH 2/3] adding some comments --- .../meteorclient/systems/modules/player/AutoEat.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/player/AutoEat.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/player/AutoEat.java index 397493098d..fd0431364a 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/player/AutoEat.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/player/AutoEat.java @@ -31,6 +31,7 @@ public class AutoEat extends Module { private static final Class[] AURAS = new Class[] { KillAura.class, CrystalAura.class, AnchorAura.class, BedAura.class }; + //BARITONE related modules private static final Class[] BARITONE_MODULES = new Class[] { InfinityMiner.class }; private final SettingGroup sgGeneral = settings.getDefaultGroup(); @@ -187,6 +188,7 @@ private void startEating() { if (pauseBaritone.get() && PathManagers.get().isPathing() && !wasBaritone) { wasBaritone = true; PathManagers.get().pause(); + // pause baritone related modules (listed in BARITONE_MODULES) for (Class klass : BARITONE_MODULES) { Module module = Modules.get().get(klass); @@ -228,6 +230,7 @@ private void stopEating() { if (pauseBaritone.get() && wasBaritone) { wasBaritone = false; PathManagers.get().resume(); + // Resume all paused baritone related modules (listed in BARITONE_MODULES) for (Class klass : BARITONE_MODULES) { Module module = Modules.get().get(klass); From 12913904e2fdd8a08adbf4a3703ef7c22f373ddd Mon Sep 17 00:00:00 2001 From: safder <107740161+safder2000@users.noreply.github.com> Date: Wed, 25 Oct 2023 16:02:20 +0530 Subject: [PATCH 3/3] Update AutoEat.java --- .../meteorclient/systems/modules/player/AutoEat.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/player/AutoEat.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/player/AutoEat.java index fd0431364a..17a2996a76 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/player/AutoEat.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/player/AutoEat.java @@ -16,7 +16,7 @@ import meteordevelopment.meteorclient.systems.modules.combat.BedAura; import meteordevelopment.meteorclient.systems.modules.combat.CrystalAura; import meteordevelopment.meteorclient.systems.modules.combat.KillAura; -import meteordevelopment.meteorclient.systems.modules.player.AutoEat.ThresholdMode; +import meteordevelopment.meteorclient.systems.modules.world.InfinityMiner; import meteordevelopment.meteorclient.utils.Utils; import meteordevelopment.meteorclient.utils.player.InvUtils; import meteordevelopment.meteorclient.utils.player.SlotUtils;