Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisTestUser committed Jan 2, 2024
1 parent d989726 commit 8257cc7
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/main/java/net/wurstclient/hacks/AutoLeaveHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ public final class AutoLeaveHack extends Hack implements UpdateListener
"Disable AutoReconnect", "Automatically turns off AutoReconnect when"
+ " AutoLeave makes you leave the server.",
true);
private final SliderSetting totems = new SliderSetting("Totems",
private final SliderSetting totems = new SliderSetting("Totems",
"Effectively disables AutoLeave until the number of totems you have is at or below this value.\n"
+ "Drag the slider to the right to turn off this feature.",
11, 0, 11, 1, ValueDisplay.INTEGER.withSuffix(" totems")
.withLabel(11, "unlimited"));
11, 0, 11, 1,
ValueDisplay.INTEGER.withSuffix(" totems").withLabel(11, "unlimited"));

public AutoLeaveHack()
{
Expand All @@ -58,7 +58,7 @@ public AutoLeaveHack()
addSetting(health);
addSetting(mode);
addSetting(disableAutoReconnect);
addSetting(totems);
addSetting(totems);
}

@Override
Expand Down Expand Up @@ -97,7 +97,8 @@ public void onUpdate()
return;

// check totems
if(totems.getValueI() != 11 && countTotems(MC.player.getInventory()) > totems.getValueI())
if(totems.getValueI() != 11
&& countTotems(MC.player.getInventory()) > totems.getValueI())
return;

// leave server
Expand Down Expand Up @@ -137,7 +138,7 @@ private int countTotems(PlayerInventory inventory)
for(int slot = 0; slot <= 36; slot++)
if(inventory.getStack(slot).getItem() == Items.TOTEM_OF_UNDYING)
totems++;

ItemStack offhandStack = inventory.getStack(40);
if(offhandStack.getItem() == Items.TOTEM_OF_UNDYING)
totems++;
Expand Down

0 comments on commit 8257cc7

Please sign in to comment.