diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/game/CrashReportAnalyzer.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/game/CrashReportAnalyzer.java index 44b64a0f1..4db0f8988 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/game/CrashReportAnalyzer.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/game/CrashReportAnalyzer.java @@ -101,7 +101,7 @@ public final class CrashReportAnalyzer { UNSATISFIED_LINK_ERROR(Pattern.compile("java.lang.UnsatisfiedLinkError: Failed to locate library: (?.*)"), "name"), //https://github.com/huanghongxun/HMCL/pull/1813 - OPTIFINE_IS_NOT_COMPATIBLE_WITH_FORGE(Pattern.compile("(java\\.lang\\.NoSuchMethodError: 'void net\\.minecraft\\.client\\.renderer\\.texture\\.SpriteContents\\.\\(net\\.minecraft\\.resources\\.ResourceLocation, |java\\.lang\\.NoSuchMethodError: 'void net\\.minecraftforge\\.client\\.gui\\.overlay\\.ForgeGui\\.renderSelectedItemName\\(net\\.minecraft\\.client\\.gui\\.GuiGraphics, int\\)'|java.lang.NoSuchMethodError: 'java\\.lang\\.String com\\.mojang\\.blaze3d\\.systems\\.RenderSystem\\.getBackendDescription\\(\\)'|java\\.lang\\.NoSuchMethodError: 'net\\.minecraft\\.network\\.chat\\.FormattedText net\\.minecraft\\.client\\.gui\\.Font\\.ellipsize\\(net\\.minecraft\\.network\\.chat\\.FormattedText, int\\)'|java\\.lang\\.NoSuchMethodError: 'void net\\.minecraft\\.server\\.level\\.DistanceManager\\.(.*?)\\(net\\.minecraft\\.server\\.level\\.TicketType, net\\.minecraft\\.world\\.level\\.ChunkPos, int, java\\.lang\\.Object, boolean\\)'|java\\.lang\\.NoSuchMethodError: 'void net\\.minecraft\\.client\\.renderer\\.block\\.model\\.BakedQuad\\.\\(int\\[\\], int, net\\.minecraft\\.core\\.Direction, net\\.minecraft\\.client\\.renderer\\.texture\\.TextureAtlasSprite, boolean, boolean\\)'|TRANSFORMER/net\\.optifine/net\\.optifine\\.reflect\\.Reflector\\.\\(Reflector\\.java)")), + OPTIFINE_IS_NOT_COMPATIBLE_WITH_FORGE(Pattern.compile("(java\\.lang\\.NoSuchMethodError: 'java\\.lang\\.Class sun\\.misc\\.Unsafe\\.defineAnonymousClass\\(java\\.lang\\.Class, byte\\[\\], java\\.lang\\.Object\\[\\]\\)'|java\\.lang\\.NoSuchMethodError: 'void net\\.minecraft\\.client\\.renderer\\.texture\\.SpriteContents\\.\\\\(net\\.minecraft\\.resources\\.ResourceLocation, |java\\.lang\\.NoSuchMethodError: 'void net\\.minecraftforge\\.client\\.gui\\.overlay\\.ForgeGui\\.renderSelectedItemName\\(net\\.minecraft\\.client\\.gui\\.GuiGraphics, int\\)'|java\\.lang\\.NoSuchMethodError: 'java\\.lang\\.String com\\.mojang\\.blaze3d\\.systems\\.RenderSystem\\.getBackendDescription\\(\\)'|java\\.lang\\.NoSuchMethodError: 'net\\.minecraft\\.network\\.chat\\.FormattedText net\\.minecraft\\.client\\.gui\\.Font\\.ellipsize\\(net\\.minecraft\\.network\\.chat\\.FormattedText, int\\)'|java\\.lang\\.NoSuchMethodError: 'void net\\.minecraft\\.server\\.level\\.DistanceManager\\.(.*?)\\(net\\.minecraft\\.server\\.level\\.TicketType, net\\.minecraft\\.world\\.level\\.ChunkPos, int, java\\.lang\\.Object, boolean\\)'|java\\.lang\\.NoSuchMethodError: 'void net\\.minecraft\\.client\\.renderer\\.block\\.model\\.BakedQuad\\.\\\\(int\\[\\], int, net\\.minecraft\\.core\\.Direction, net\\.minecraft\\.client\\.renderer\\.texture\\.TextureAtlasSprite, boolean, boolean\\)'|TRANSFORMER/net\\.optifine/net\\.optifine\\.reflect\\.Reflector\\.\\\\(Reflector\\.java)")), MOD_FILES_ARE_DECOMPRESSED(Pattern.compile("(The directories below appear to be extracted jar files\\. Fix this before you continue|Extracted mod jars found, loading will NOT continue)")),//Mod文件被解压 OPTIFINE_CAUSES_THE_WORLD_TO_FAIL_TO_LOAD(Pattern.compile("java\\.lang\\.NoSuchMethodError: net\\.minecraft\\.world\\.server\\.ChunkManager$ProxyTicketManager\\.shouldForceTicks\\(J\\)Z")),//OptiFine导致无法加载世界 https://www.minecraftforum.net/forums/support/java-edition-support/3051132-exception-ticking-world TOO_MANY_MODS_LEAD_TO_EXCEEDING_THE_ID_LIMIT(Pattern.compile("maximum id range exceeded")),//Mod过多导致超出ID限制 diff --git a/HMCLCore/src/test/java/org/jackhuang/hmcl/game/CrashReportAnalyzerTest.java b/HMCLCore/src/test/java/org/jackhuang/hmcl/game/CrashReportAnalyzerTest.java index f1c5acc73..84fff31e1 100644 --- a/HMCLCore/src/test/java/org/jackhuang/hmcl/game/CrashReportAnalyzerTest.java +++ b/HMCLCore/src/test/java/org/jackhuang/hmcl/game/CrashReportAnalyzerTest.java @@ -487,6 +487,13 @@ public class CrashReportAnalyzerTest { CrashReportAnalyzer.Rule.OPTIFINE_IS_NOT_COMPATIBLE_WITH_FORGE); } + @Test + public void optifineIsNotCompatibleWithForge5() throws IOException { + CrashReportAnalyzer.Result result = findResultByRule( + CrashReportAnalyzer.anaylze(loadLog("/logs/optifine_is_not_compatible_with_forge6.txt")), + CrashReportAnalyzer.Rule.OPTIFINE_IS_NOT_COMPATIBLE_WITH_FORGE); + } + @Test public void shadersMod() throws IOException { CrashReportAnalyzer.Result result = findResultByRule( diff --git a/HMCLCore/src/test/resources/logs/optifine_is_not_compatible_with_forge6.txt b/HMCLCore/src/test/resources/logs/optifine_is_not_compatible_with_forge6.txt new file mode 100644 index 000000000..1e1ce8b30 --- /dev/null +++ b/HMCLCore/src/test/resources/logs/optifine_is_not_compatible_with_forge6.txt @@ -0,0 +1,69 @@ +WARNING: Unknown module: cpw.mods.bootstraplauncher specified to --add-exports +[authlib-injector] [INFO] Logging file: C:\Users\********\AppData\Roaming\.minecraft\versions\鎮犵劧浜虹敓1.0\authlib-injector.log +[authlib-injector] [INFO] Version: 1.2.3 +[authlib-injector] [INFO] Authentication server: https://littleskin.cn/api/yggdrasil +[authlib-injector] [INFO] Httpd is running on port 50187 +[authlib-injector] [INFO] Transformed [com.mojang.patchy.BlockedServers] with [Constant URL Transformer] +[authlib-injector] [INFO] Transformed [com.mojang.authlib.HttpAuthenticationService] with [ConcatenateURL Workaround] +[authlib-injector] [INFO] Transformed [com.mojang.authlib.yggdrasil.YggdrasilEnvironment] with [Constant URL Transformer] +[authlib-injector] [INFO] Transformed [com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService] with [Texture Whitelist Transformer] +[authlib-injector] [INFO] Transformed [com.mojang.authlib.properties.Property] with [Yggdrasil Public Key Transformer] +[16:59:07] [main/INFO]: ModLauncher running: args [--username, butie, --version, 鎮犵劧浜虹敓1.0, --gameDir, C:\Users\********\AppData\Roaming\.minecraft\versions\鎮犵劧浜虹敓1.0, --assetsDir, C:\Users\********\AppData\Roaming\.minecraft\assets, --assetIndex, 1.16, --uuid, 35bbf0e6417f47e78f536c90400c0c8b, --accessToken, ????????, --userType, Mojang, --versionType, PCL2, --width, 854, --height, 480, --launchTarget, fmlclient, --fml.forgeVersion, 36.2.39, --fml.mcVersion, 1.16.5, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20210115.111550, --tweakClass, optifine.OptiFineForgeTweaker] +[16:59:07] [main/INFO]: ModLauncher 8.1.3+8.1.3+main-8.1.x.c94d18ec starting: java version 17.0.1 by Microsoft +[16:59:07] [main/INFO]: OptiFineTransformationService.onLoad +[16:59:07] [main/INFO]: OptiFine ZIP file: C:\Users\********\AppData\Roaming\.minecraft\libraries\optifine\OptiFine\1.16.5_HD_U_G8\OptiFine-1.16.5_HD_U_G8.jar +[16:59:07] [main/INFO]: Target.PRE_CLASS is available +[16:59:07] [main/INFO]: Added Lets Encrypt root certificates as additional trust +[16:59:07] [main/INFO]: SpongePowered MIXIN Subsystem Version=0.8.4 Source=file:/C:/Users/********/AppData/Roaming/.minecraft/libraries/org/spongepowered/mixin/0.8.4/mixin-0.8.4.jar Service=ModLauncher Env=CLIENT +[16:59:07] [main/INFO]: OptiFineTransformationService.initialize +[16:59:09] [main/INFO]: OptiFineTransformationService.transformers +[16:59:09] [main/INFO]: Targets: 311 +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1077]: java.lang.reflect.InvocationTargetException +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1077]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1077]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1077]: at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1077]: at java.base/java.lang.reflect.Method.invoke(Method.java:568) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1077]: at oolloo.jlw.Wrapper.invokeMain(Wrapper.java:58) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1077]: at oolloo.jlw.Wrapper.main(Wrapper.java:51) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1086]: Caused by: java.lang.ExceptionInInitializerError +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1086]: at org.openjdk.nashorn.internal.runtime.Context.compile(Context.java:1509) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1086]: at org.openjdk.nashorn.internal.runtime.Context.compileScript(Context.java:1449) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1086]: at org.openjdk.nashorn.internal.runtime.Context.compileScript(Context.java:759) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1086]: at org.openjdk.nashorn.api.scripting.NashornScriptEngine.compileImpl(NashornScriptEngine.java:528) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1086]: at org.openjdk.nashorn.api.scripting.NashornScriptEngine.compileImpl(NashornScriptEngine.java:517) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1086]: at org.openjdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:395) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1086]: at org.openjdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:146) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1086]: at java.scripting/javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1086]: at net.minecraftforge.coremod.CoreMod.initialize(CoreMod.java:40) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1086]: at net.minecraftforge.coremod.CoreModEngine.initialize(CoreModEngine.java:75) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1086]: at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1086]: at net.minecraftforge.coremod.CoreModEngine.initializeCoreMods(CoreModEngine.java:69) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1086]: at net.minecraftforge.coremod.CoreModProvider.getCoreModTransformers(CoreModProvider.java:17) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1086]: at net.minecraftforge.fml.loading.FMLServiceProvider.transformers(FMLServiceProvider.java:142) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1086]: at cpw.mods.modlauncher.TransformationServiceDecorator.gatherTransformers(TransformationServiceDecorator.java:74) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1086]: at cpw.mods.modlauncher.TransformationServicesHandler.lambda$initialiseServiceTransformers$6(TransformationServicesHandler.java:101) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1086]: at java.base/java.util.HashMap$Values.forEach(HashMap.java:1065) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1086]: at cpw.mods.modlauncher.TransformationServicesHandler.initialiseServiceTransformers(TransformationServicesHandler.java:101) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1086]: at cpw.mods.modlauncher.TransformationServicesHandler.initializeTransformationServices(TransformationServicesHandler.java:64) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1086]: at cpw.mods.modlauncher.Launcher.run(Launcher.java:76) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1086]: at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) +[16:59:10] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1086]: ... 6 more +[16:59:10] [main/INFO]: [java.lang.Throwable:printStackTrace:659]: Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: no such method: sun.misc.Unsafe.defineAnonymousClass(Class,byte[],Object[])Class/invokeVirtual +[16:59:10] [main/INFO]: [java.lang.Throwable:printStackTrace:659]: at org.openjdk.nashorn.internal.runtime.Context$AnonymousContextCodeInstaller.lambda$getDefineAnonymousClass$0(Context.java:335) +[16:59:10] [main/INFO]: [java.lang.Throwable:printStackTrace:659]: at java.base/java.security.AccessController.doPrivileged(AccessController.java:318) +[16:59:10] [main/INFO]: [java.lang.Throwable:printStackTrace:659]: at org.openjdk.nashorn.internal.runtime.Context$AnonymousContextCodeInstaller.getDefineAnonymousClass(Context.java:327) +[16:59:10] [main/INFO]: [java.lang.Throwable:printStackTrace:659]: at org.openjdk.nashorn.internal.runtime.Context$AnonymousContextCodeInstaller.(Context.java:317) +[16:59:10] [main/INFO]: [java.lang.Throwable:printStackTrace:659]: ... 27 more +[16:59:10] [main/INFO]: [java.lang.Throwable:printStackTrace:682]: Caused by: java.lang.NoSuchMethodException: no such method: sun.misc.Unsafe.defineAnonymousClass(Class,byte[],Object[])Class/invokeVirtual +[16:59:10] [main/INFO]: [java.lang.Throwable:printStackTrace:682]: at java.base/java.lang.invoke.MemberName.makeAccessException(MemberName.java:976) +[16:59:10] [main/INFO]: [java.lang.Throwable:printStackTrace:682]: at java.base/java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1117) +[16:59:10] [main/INFO]: [java.lang.Throwable:printStackTrace:682]: at java.base/java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:3649) +[16:59:10] [main/INFO]: [java.lang.Throwable:printStackTrace:682]: at java.base/java.lang.invoke.MethodHandles$Lookup.findVirtual(MethodHandles.java:2680) +[16:59:10] [main/INFO]: [java.lang.Throwable:printStackTrace:682]: at org.openjdk.nashorn.internal.runtime.Context$AnonymousContextCodeInstaller.lambda$getDefineAnonymousClass$0(Context.java:329) +[16:59:10] [main/INFO]: [java.lang.Throwable:printStackTrace:682]: ... 30 more +[16:59:10] [main/INFO]: [java.lang.Throwable:printEnclosedStackTrace:724]: Caused by: java.lang.NoSuchMethodError: 'java.lang.Class sun.misc.Unsafe.defineAnonymousClass(java.lang.Class, byte[], java.lang.Object[])' +[16:59:10] [main/INFO]: [java.lang.Throwable:printEnclosedStackTrace:724]: at java.base/java.lang.invoke.MethodHandleNatives.resolve(Native Method) +[16:59:10] [main/INFO]: [java.lang.Throwable:printEnclosedStackTrace:724]: at java.base/java.lang.invoke.MemberName$Factory.resolve(MemberName.java:1085) +[16:59:10] [main/INFO]: [java.lang.Throwable:printEnclosedStackTrace:724]: at java.base/java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1114) +[16:59:10] [main/INFO]: [java.lang.Throwable:printEnclosedStackTrace:724]: ... 33 more +Exception in thread "main" \ No newline at end of file