Search code examples
minecraftminecraft-forge

Optifine causes crash: java.lang.IllegalStateException: Lock is no longer valid


Recently, I have started a modded survival with a decent number of mods. When I loaded the world, everything was A Ok. That is until I tried to rejoin, giving out the error java.lang.IllegalStateException: Lock is no longer valid. I've looked on other websites and it seems that Optifine is what is causing the crash. I depend on Optifine when it comes to modded Minecraft.

How could I possibly fix this problem while using Optifine also?

Here is the crash report:

java.lang.IllegalStateException: Lock is no longer valid
at net.minecraft.world.storage.SaveFormat$LevelSave.func_237301_i_(SaveFormat.java:296) ~[?:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B}
at net.minecraft.world.storage.SaveFormat$LevelSave.func_237298_f_(SaveFormat.java:360) ~[?:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B}
at net.minecraft.server.MinecraftServer.func_184109_z(MinecraftServer.java:769) ~[?:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:imm_ptl_mixins.json:common.MixinMinecraftServer,pl:mixin:APP:imm_ptl_mixins.json:common.portal_generation.MixinMinecraftServer_P,pl:mixin:APP:imm_ptl_peripheral_mixins.json:common.alternate_dimension.MixinMinecraftServer_A,pl:mixin:APP:imm_ptl_peripheral_mixins.json:common.altius_world.MixinMinecraftServer_A,pl:mixin:A}
at net.minecraft.server.MinecraftServer.func_184106_y(MinecraftServer.java:763) ~[?:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:imm_ptl_mixins.json:common.MixinMinecraftServer,pl:mixin:APP:imm_ptl_mixins.json:common.portal_generation.MixinMinecraftServer_P,pl:mixin:APP:imm_ptl_peripheral_mixins.json:common.alternate_dimension.MixinMinecraftServer_A,pl:mixin:APP:imm_ptl_peripheral_mixins.json:common.altius_world.MixinMinecraftServer_A,pl:mixin:A}
at net.minecraft.client.renderer.GameRenderer.func_195458_a(GameRenderer.java:699) ~[?:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,xf:OptiFine:default,xf:fml:xaerominimap:xaero_gamerenderer_resetprojectionmatrix,xf:fml:xaerominimap:xaero_gamerenderer_renderworld,pl:mixin:APP:imm_ptl_mixins.json:client.block_manipulation.MixinGameRenderer_B,pl:mixin:APP:imm_ptl_mixins.json:client.render.MixinGameRenderer,pl:mixin:A}
at net.minecraft.client.Minecraft.func_195542_b(Minecraft.java:976) [?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:computing_frames,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:imm_ptl_mixins.json:client.MixinMinecraftClient,pl:mixin:APP:imm_ptl_mixins.json:client.block_manipulation.MixinMinecraftClient_B,pl:mixin:A,pl:runtimedistcleaner:A}
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:607) [?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:computing_frames,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:imm_ptl_mixins.json:client.MixinMinecraftClient,pl:mixin:APP:imm_ptl_mixins.json:client.block_manipulation.MixinMinecraftClient_B,pl:mixin:A,pl:runtimedistcleaner:A}
at net.minecraft.client.main.Main.main(Main.java:184) [?:?] {re:classloading,pl:runtimedistcleaner:A}
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] {}
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51] {}
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51] {}
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51] {}
at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51) [forge-1.16.4-35.1.37.jar:35.1] {}
at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$508/435034854.call(Unknown Source) [forge-1.16.4-35.1.37.jar:35.1] {}
at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {}
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {}
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {}
at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {}
at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {}

A detailed walkthrough of the error, its code path and all known details is as follows:

Thread: Render thread
Stacktrace:
    at net.minecraft.world.storage.SaveFormat$LevelSave.func_237301_i_(SaveFormat.java:296) ~[?:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B}
    at net.minecraft.world.storage.SaveFormat$LevelSave.func_237298_f_(SaveFormat.java:360) ~[?:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B}
    at net.minecraft.server.MinecraftServer.func_184109_z(MinecraftServer.java:769) ~[?:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:imm_ptl_mixins.json:common.MixinMinecraftServer,pl:mixin:APP:imm_ptl_mixins.json:common.portal_generation.MixinMinecraftServer_P,pl:mixin:APP:imm_ptl_peripheral_mixins.json:common.alternate_dimension.MixinMinecraftServer_A,pl:mixin:APP:imm_ptl_peripheral_mixins.json:common.altius_world.MixinMinecraftServer_A,pl:mixin:A}
    at net.minecraft.server.MinecraftServer.func_184106_y(MinecraftServer.java:763) ~[?:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:imm_ptl_mixins.json:common.MixinMinecraftServer,pl:mixin:APP:imm_ptl_mixins.json:common.portal_generation.MixinMinecraftServer_P,pl:mixin:APP:imm_ptl_peripheral_mixins.json:common.alternate_dimension.MixinMinecraftServer_A,pl:mixin:APP:imm_ptl_peripheral_mixins.json:common.altius_world.MixinMinecraftServer_A,pl:mixin:A}
-- Affected level --
Details:
    All players: 1 total; [ClientPlayerEntity['Pale_Gray'/158, l='ClientWorld minecraft:overworld', x=8.50, y=65.00, z=8.50]]
    Chunk stats: Client Chunks (ImmPtl) 0
    Level dimension: minecraft:overworld
    Level spawn location: World: (8,64,8), Chunk: (at 8,4,8 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
    Level time: 0 game time, 0 day time
    Server brand: ~~NULL~~
    Server type: Integrated singleplayer server
Stacktrace:
    at net.minecraft.client.world.ClientWorld.func_72914_a(ClientWorld.java:617) ~[?:?] {re:mixin,re:classloading,xf:OptiFine:default,xf:fml:xaerominimap:xaero_clientworldclass,xf:fml:xaeroworldmap:xaero_wm_clientworldclass,pl:mixin:A}
    at net.minecraft.client.Minecraft.func_71396_d(Minecraft.java:2024) [?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:computing_frames,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:imm_ptl_mixins.json:client.MixinMinecraftClient,pl:mixin:APP:imm_ptl_mixins.json:client.block_manipulation.MixinMinecraftClient_B,pl:mixin:A,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:628) [?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:computing_frames,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:imm_ptl_mixins.json:client.MixinMinecraftClient,pl:mixin:APP:imm_ptl_mixins.json:client.block_manipulation.MixinMinecraftClient_B,pl:mixin:A,pl:runtimedistcleaner:A}
    at net.minecraft.client.main.Main.main(Main.java:184) [?:?] {re:classloading,pl:runtimedistcleaner:A}
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] {}
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51] {}
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51] {}
    at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51] {}
    at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51) [forge-1.16.4-35.1.37.jar:35.1] {}
    at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$508/435034854.call(Unknown Source) [forge-1.16.4-35.1.37.jar:35.1] {}
    at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {}
    at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {}
    at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {}


-- System Details --
Details:
    Minecraft Version: 1.16.4
    Minecraft Version ID: 1.16.4
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_51, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 1435255904 bytes (1368 MB) / 4261412864 bytes (4064 MB) up to 4294967296 bytes (4096 MB)
    CPUs: 4
    JVM Flags: 9 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx4G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
    ModLauncher: 8.0.9+86+master.3cf110c
    ModLauncher launch target: fmlclient
    ModLauncher naming: srg
    ModLauncher services: 
        /mixin-0.8.2.jar mixin PLUGINSERVICE 
        /eventbus-4.0.0.jar eventbus PLUGINSERVICE 
        /forge-1.16.4-35.1.37.jar object_holder_definalize PLUGINSERVICE 
        /forge-1.16.4-35.1.37.jar runtime_enum_extender PLUGINSERVICE 
        /accesstransformers-3.0.1.jar accesstransformer PLUGINSERVICE 
        /forge-1.16.4-35.1.37.jar capability_inject_definalize PLUGINSERVICE 
        /forge-1.16.4-35.1.37.jar runtimedistcleaner PLUGINSERVICE 
        /mixin-0.8.2.jar mixin TRANSFORMATIONSERVICE 
        /OptiFine_1.16.4_HD_U_G6.jar OptiFine TRANSFORMATIONSERVICE 
        /OptiForge-MC1.16.4-0.4.6.jar optiforge TRANSFORMATIONSERVICE 
        /forge-1.16.4-35.1.37.jar fml TRANSFORMATIONSERVICE 
        /OptiForge-MC1.16.4-0.4.6.jar FakeOptiFine TRANSFORMATIONSERVICE 
        /MixinBootstrap-1.0.5.jar mixinbootstrap TRANSFORMATIONSERVICE 
        /OptiForge-MC1.16.4-0.4.6.jar optiforgewrapper TRANSFORMATIONSERVICE 
    FML: 35.1
    Forge: net.minecraftforge:35.1.37
    FML Language Providers: 
        [email protected]
        minecraft@1
    Mod List:

Solution

  • Try logging into the world without Optifine, walking away from where the creeper exploded, then save the world, then come back into with Optifine loaded. I'm no Java developer, so I'm not sure what this error message means, but it sounds something like it ran out of video memory. Optifine is really buggy around particles in 1.16, so it may be something like that. If I use shaders, I have issues with particles. And I have an RTX 2070 Super. Oh, and be sure you're running the latest version of Optifine for 1.16.4.