Skip to content

Commit

Permalink
Fix McVersionLookup crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Lassebq committed Sep 6, 2024
1 parent 338f55c commit d6ec7e0
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ private Path getLaunchwrapperSource() {
@Override
public boolean locateGame(FabricLauncher launcher, String[] args) {
this.envType = launcher.getEnvironmentType();


String entrypoint = null;
try {
LibClassifier<LWLib> classifier = new LibClassifier<>(LWLib.class, envType, this);
LWLib envGameLib = envType == EnvType.CLIENT ? LWLib.MC_CLIENT : LWLib.MC_SERVER;
Expand All @@ -115,6 +116,9 @@ public boolean locateGame(FabricLauncher launcher, String[] args) {

envGameJar = classifier.getOrigin(envGameLib);
if (envGameJar == null) return false;

entrypoint = classifier.getClassName(envGameLib);
if(entrypoint == null) return false;

gameJar = envGameJar;
launchwrapperJar = classifier.getOrigin(LWLib.LAUNCHWRAPPER);
Expand Down Expand Up @@ -142,7 +146,7 @@ public boolean locateGame(FabricLauncher launcher, String[] args) {
share.put("fabric-loader:inputGameJar", gameJar); // deprecated
share.put("fabric-loader:inputGameJars", Collections.singleton(gameJar));

versionData = McVersionLookup.getVersion(Collections.singletonList(gameJar), "net.minecraft.client.Minecraft", config.version.get());
versionData = McVersionLookup.getVersion(Collections.singletonList(gameJar), entrypoint, config.version.get());
return true;
}

Expand Down

0 comments on commit d6ec7e0

Please sign in to comment.