diff --git a/src/main/java/dynamic_fps/impl/DynamicFPSMod.java b/src/main/java/dynamic_fps/impl/DynamicFPSMod.java index 8acbdaa0..558b95ac 100644 --- a/src/main/java/dynamic_fps/impl/DynamicFPSMod.java +++ b/src/main/java/dynamic_fps/impl/DynamicFPSMod.java @@ -176,6 +176,15 @@ private static void checkForStateChanges() { minecraft = Minecraft.getInstance(); } + if (minecraft.isSameThread()) { + checkForStateChanges0(); + } else { + // Schedule check for the beginning of the next frame + minecraft.tell(DynamicFPSMod::checkForStateChanges0); + } + } + + private static void checkForStateChanges0() { PowerState current; if (isDisabledInternal()) {