Fix loom failing to find main class when in a loader dev env

dev/0.11
modmuss50 2019-12-27 11:52:35 +00:00
parent c2d61875e1
commit 4cf2b265eb
1 changed files with 7 additions and 1 deletions

View File

@ -29,6 +29,7 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.ParserConfigurationException;
@ -216,7 +217,12 @@ public class RunConfig {
return mainClassName; return mainClassName;
} }
throw new RuntimeException("Failed to find mainclass"); // Fallback to default class names, happens when in a loader dev env
if ("launchwrapper".equals(extension.getLoaderLaunchMethod())) {
return "net.minecraft.launchwrapper.Launch";
}
return "net.fabricmc.loader.launch.knot.Knot" + side.substring(0, 1).toUpperCase(Locale.ROOT) + side.substring(1).toLowerCase(Locale.ROOT);
} }
private static String quoteIfNeeded(String input) { private static String quoteIfNeeded(String input) {