Skip to content

Commit

Permalink
Merge pull request #57 from coltonk9043/1.21
Browse files Browse the repository at this point in the history
Moved around module state logic for better reliability. Fixed autofish.
  • Loading branch information
coltonk9043 authored Sep 22, 2024
2 parents ae5f388 + aee575b commit 7d38e5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
15 changes: 5 additions & 10 deletions src/main/java/net/aoba/module/Module.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,15 @@ public boolean getState() {
public void setState(boolean state) {
if (this.state == state) return;

this.onToggle();

if (state) {
this.state = true;
this.onEnable();
this.state = true;
} else {
this.state = false;
this.onDisable();
this.state = false;
}

this.onToggle();
}

/**
Expand Down Expand Up @@ -269,12 +269,7 @@ public boolean isKeyPressed(int button) {
* The state is then updated accordingly.
*/
public void toggle() {
if (this.state) {
this.onDisable();
} else {
this.onEnable();
}
this.setState(!this.getState());
setState(!state);
}


Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/aoba/module/modules/misc/AutoFish.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class AutoFish extends Module implements ReceivePacketListener {
.id("autofish_autotoggle")
.displayName("Auto Toggle")
.description("Automatically toggles off if no fishing rod is found in the hotbar.")
.defaultValue(true)
.defaultValue(false)
.build();

public AutoFish() {
Expand Down

0 comments on commit 7d38e5d

Please sign in to comment.