From 1de8841a991b9667ba21708338a824a584d329a4 Mon Sep 17 00:00:00 2001 From: Babbaj Date: Fri, 20 Dec 2019 12:46:23 -0500 Subject: [PATCH] Allow AutoHotbarReplenish to work with a gui open --- .../matt/forgehax/mods/AutoHotbarReplenish.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/matt/forgehax/mods/AutoHotbarReplenish.java b/src/main/java/com/matt/forgehax/mods/AutoHotbarReplenish.java index f2bbfc5bb..b17508653 100644 --- a/src/main/java/com/matt/forgehax/mods/AutoHotbarReplenish.java +++ b/src/main/java/com/matt/forgehax/mods/AutoHotbarReplenish.java @@ -49,10 +49,18 @@ public class AutoHotbarReplenish extends ToggleMod { .builders() .newSettingBuilder() .name("tick-delay") - .description( - "Number of ticks between each window click packet. 0 will have no limit and a negative value will send n packets per tick") + .description("Number of ticks between each window click packet. 0 will have no limit and a negative value will send n packets per tick") .defaultTo(1) .build(); + + private final Setting no_gui = + getCommandStub() + .builders() + .newSettingBuilder() + .name("no_gui") + .description("Don't run when a gui is open") + .defaultTo(true) + .build(); private TaskChain tasks = TaskChain.empty(); private long tickCount = 0; @@ -143,7 +151,7 @@ public void onTick(ClientTickEvent event) { } // only process when a gui isn't opened by the player - if (MC.currentScreen != null) { + if (MC.currentScreen != null && no_gui.get()) { return; }