Refactor Userdev and Forgedev launching.

Locating mods on the classpath in dev should solve linked MC sources when debugging.
As well as loading deobfed mods.
Rewrote how arguments are handled in dev, so users can overwrite any defaults we provide.
Added basic Yggdrasil auth support. Passing in --username and --password arguments.
ONLY USE IF NECESSARY. Forge is NOT responsible for your login information.
This commit is contained in:
LexManos committed 2019-03-06 20:59:32 -08:00
1 parent 7bd7b059c4
commit 3003e33074
17 files changed
+440 -335

No files matched your search

@@ -24,8 +24,6 @@ import net.minecraftforge.fml.VersionChecker;
import net.minecraftforge.fml.loading.JarVersionLookupHandler;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.maven.artifact.versioning.ArtifactVersion;
import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
import javax.annotation.Nullable;
@@ -43,11 +41,11 @@ public class ForgeVersion
static {
LOGGER.debug(CORE, "Forge Version package {} from {}", ForgeVersion.class.getPackage(), ForgeVersion.class.getClassLoader());
String vers = JarVersionLookupHandler.getImplementationVersion(ForgeVersion.class).orElse(System.getProperty("forge.version"));
String vers = JarVersionLookupHandler.getImplementationVersion(ForgeVersion.class).orElse(System.getenv("FORGE_VERSION"));
if (vers == null) throw new RuntimeException("Missing forge version, cannot continue");
String spec = JarVersionLookupHandler.getSpecificationVersion(ForgeVersion.class).orElse(System.getProperty("forge.spec"));
String spec = JarVersionLookupHandler.getSpecificationVersion(ForgeVersion.class).orElse(System.getenv("FORGE_SPEC"));
if (spec == null) throw new RuntimeException("Missing forge spec, cannot continue");
String group = JarVersionLookupHandler.getImplementationTitle(ForgeVersion.class).orElse(System.getProperty("forge.group"));
String group = JarVersionLookupHandler.getImplementationTitle(ForgeVersion.class).orElse(System.getenv("FORGE_GROUP"));
if (group == null) {
group = "net.minecraftforge"; // If all else fails, Our normal group
}
@@ -31,14 +31,14 @@ public class MCPVersion {
static {
String vers = MCPVersion.class.getPackage().getSpecificationVersion();
if (vers == null) {
vers = System.getProperty("mc.version");
vers = System.getenv("MC_VERSION");
}
if (vers == null) throw new RuntimeException("Missing MC version, cannot continue");
mcVersion = vers;
vers = MCPVersion.class.getPackage().getImplementationVersion();
if (vers == null) {
vers = System.getProperty("mcp.version");
vers = System.getenv("MCP_VERSION");
}
if (vers == null) throw new RuntimeException("Missing MCP version, cannot continue");
mcpVersion = vers;