Skip to content

Commit

Permalink
Allow AutoHotbarReplenish to work with a gui open
Browse files Browse the repository at this point in the history
babbaj committed Dec 20, 2019
1 parent fd4a5c2 commit 1de8841
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/main/java/com/matt/forgehax/mods/AutoHotbarReplenish.java
Original file line number Diff line number Diff line change
@@ -49,10 +49,18 @@ public class AutoHotbarReplenish extends ToggleMod {
.builders()
.<Integer>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<Boolean> no_gui =
getCommandStub()
.builders()
.<Boolean>newSettingBuilder()
.name("no_gui")
.description("Don't run when a gui is open")
.defaultTo(true)
.build();

private TaskChain<Runnable> 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;
}

0 comments on commit 1de8841

Please sign in to comment.