diff --git a/src/client/java/com/emonadeo/autorun/AutoRunMod.java b/src/client/java/com/emonadeo/autorun/AutoRunMod.java index 7afea4c..225cac1 100644 --- a/src/client/java/com/emonadeo/autorun/AutoRunMod.java +++ b/src/client/java/com/emonadeo/autorun/AutoRunMod.java @@ -24,7 +24,8 @@ public class AutoRunMod implements ClientModInitializer { public static final String MODID = "autorun"; - public static final File CFG_FILE = new File(FabricLoader.getInstance().getConfigDir().toFile(), "autorun.properties"); + public static final File CFG_FILE = new File(FabricLoader.getInstance().getConfigDir().toFile(), + "autorun.properties"); private static KeyBinding keyBinding; private static Set toggled; @@ -79,8 +80,7 @@ public void onInitializeClient() { if (timeActivated != -1 && client.world != null && client.world.getTime() - timeActivated >= delayBuffer) { - x: - for (MovementDirection dir : toggled) { + x: for (MovementDirection dir : toggled) { for (KeyBinding terminator : dir.getTerminators(client)) { if (terminator.isPressed()) { // Deactivating by pressing movement key @@ -96,12 +96,11 @@ public void onInitializeClient() { ClientEntityEvents.ENTITY_UNLOAD.register((entity, clientWorld) -> { if (entity instanceof ClientPlayerEntity) { - restoreAutoJump(MinecraftClient.getInstance()); - if (!togglePersistAutoRun){ + if (!togglePersistAutoRun) { toggled.clear(); + restoreAutoJump(MinecraftClient.getInstance()); } - }; - + } }); } @@ -172,7 +171,7 @@ public static boolean isToggleAutoJump() { public static void setToggleAutoJump(boolean toggleAutoJump) { AutoRunMod.toggleAutoJump = toggleAutoJump; } - + public static boolean isPersistAutoRun() { return togglePersistAutoRun; }