Skip to content

Commit

Permalink
fix sticky key exploit
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamKracker committed Nov 25, 2024
1 parent 8e36140 commit 869ebb1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/codes/cookies/mod/CookiesMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;

import codes.cookies.mod.utils.accessors.KeyBindingAccessor;
import codes.cookies.mod.utils.cookies.CookiesUtils;
import codes.cookies.mod.utils.skyblock.LocationUtils;
import codes.cookies.mod.utils.skyblock.MayorUtils;
Expand Down Expand Up @@ -107,6 +108,10 @@ private void registerKeyBindings() {
}
while(useGardenKeybinds.wasPressed() && LocationUtils.Island.GARDEN.isActive()) {
GardenKeybindPredicate.keyBindToggle = !GardenKeybindPredicate.keyBindToggle;
for (var keybind : KeyBinding.KEYS_BY_ID.values()) {
keybind.setPressed(false);
keybind.timesPressed = 0;
}
CookiesUtils.sendMessage(Text.translatable("cookies.mod.garden.keybinds." + (GardenKeybindPredicate.keyBindToggle ? "enabled" : "disabled")), false);
}
});
Expand Down

0 comments on commit 869ebb1

Please sign in to comment.