From 949cd515183240997c1f5c99e72167e851f48973 Mon Sep 17 00:00:00 2001 From: MartinSVK12 <37455793+MartinSVK12@users.noreply.github.com> Date: Sat, 16 Dec 2023 00:42:20 +0100 Subject: [PATCH] Attempt 2. --- .../loader/impl/game/minecraft/McVersionLookup.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/minecraft/src/main/java/net/fabricmc/loader/impl/game/minecraft/McVersionLookup.java b/minecraft/src/main/java/net/fabricmc/loader/impl/game/minecraft/McVersionLookup.java index 306590658..556c1901b 100644 --- a/minecraft/src/main/java/net/fabricmc/loader/impl/game/minecraft/McVersionLookup.java +++ b/minecraft/src/main/java/net/fabricmc/loader/impl/game/minecraft/McVersionLookup.java @@ -132,7 +132,11 @@ public static void fillVersionFromJar(SimpleClassPath cp, McVersion.Builder buil } // version-like String constant used in MinecraftServer.run or another MinecraftServer method - if ((is = cp.getInputStream("net/minecraft/server/MinecraftServer.class")) != null && (fromAnalyzer(is, new MethodConstantVisitor("run"), builder) || fromAnalyzer(is, new MethodConstantRetVisitor("getMinecraftVersion"), builder))) { + if ((is = cp.getInputStream("net/minecraft/server/MinecraftServer.class")) != null && fromAnalyzer(is, new MethodConstantVisitor("run"), builder)) { + return; + } + + if ((is = cp.getInputStream("net/minecraft/server/MinecraftServer.class")) != null && fromAnalyzer(is, new MethodConstantRetVisitor("getMinecraftVersion"), builder)) { return; }