diff --git a/src/main/java/dynamic_fps/impl/DynamicFPSMod.java b/src/main/java/dynamic_fps/impl/DynamicFPSMod.java index 121518aa..7d020cbd 100644 --- a/src/main/java/dynamic_fps/impl/DynamicFPSMod.java +++ b/src/main/java/dynamic_fps/impl/DynamicFPSMod.java @@ -172,6 +172,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()) {