mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 08:44:25 +00:00
Include project group in ForgeVersion and determine path to patched jar.
While testing we install to net.minecraftforge.test. So don't hardcode it.
This commit is contained in:
1 parent
a3c8e04ee6
commit
76d912c0ba
4 files changed
+29
-10
No files matched your search
@@ -29,6 +29,7 @@ import net.minecraftforge.versions.mcp.MCPVersion;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
@@ -49,7 +50,7 @@ public class FMLClientLaunchProvider extends FMLCommonLaunchHandler implements I
|
||||
public Path[] identifyTransformationTargets()
|
||||
{
|
||||
Path libsPath = findLibsPath();
|
||||
Path patchedBinariesPath = libsPath.resolve(Paths.get("net","minecraftforge","forge",MCPVersion.getMCVersion()+"-"+ForgeVersion.getVersion(),"forge-"+MCPVersion.getMCVersion()+"-"+ForgeVersion.getVersion()+"-client.jar"));
|
||||
Path patchedBinariesPath = libsPath.resolve(Paths.get(ForgeVersion.getGroup().replace('.', File.separatorChar), "forge", MCPVersion.getMCVersion() + "-" + ForgeVersion.getVersion(), "forge-" + MCPVersion.getMCVersion() + "-" + ForgeVersion.getVersion() + "-client.jar"));
|
||||
Path srgMcPath = libsPath.resolve(Paths.get("net","minecraft", "client", MCPVersion.getMCPandMCVersion(), "client-"+MCPVersion.getMCPandMCVersion()+"-srg.jar"));
|
||||
LOGGER.info("SRG MC at {} is {}", srgMcPath.toString(), Files.exists(srgMcPath) ? "present" : "missing");
|
||||
LOGGER.info("Forge patches at {} is {}", patchedBinariesPath.toString(), Files.exists(patchedBinariesPath) ? "present" : "missing");
|
||||
|
||||
@@ -28,6 +28,7 @@ import net.minecraftforge.versions.mcp.MCPVersion;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
@@ -47,7 +48,7 @@ public class FMLServerLaunchProvider extends FMLCommonLaunchHandler implements I
|
||||
public Path[] identifyTransformationTargets()
|
||||
{
|
||||
Path libsPath = findLibsPath();
|
||||
Path patchedBinariesPath = libsPath.resolve(Paths.get("net","minecraftforge","forge",MCPVersion.getMCVersion()+"-"+ForgeVersion.getVersion(),"forge-"+MCPVersion.getMCVersion()+"-"+ForgeVersion.getVersion()+"-server.jar"));
|
||||
Path patchedBinariesPath = libsPath.resolve(Paths.get(ForgeVersion.getGroup().replace('.', File.separatorChar), "forge", MCPVersion.getMCVersion() + "-" + ForgeVersion.getVersion(), "forge-" + MCPVersion.getMCVersion() + "-" + ForgeVersion.getVersion() + "-server.jar"));
|
||||
Path srgMcPath = libsPath.resolve(Paths.get("net","minecraft", "server", MCPVersion.getMCPandMCVersion(), "server-"+MCPVersion.getMCPandMCVersion()+"-srg.jar"));
|
||||
LOGGER.info("SRG MC at {} is {}", srgMcPath.toString(), Files.exists(srgMcPath) ? "present" : "missing");
|
||||
LOGGER.info("Forge patches at {} is {}", patchedBinariesPath.toString(), Files.exists(patchedBinariesPath) ? "present" : "missing");
|
||||
|
||||
@@ -38,8 +38,8 @@ public class ForgeVersion
|
||||
public static final String mcpVersion = "9.42";
|
||||
|
||||
private static final String forgeVersion;
|
||||
|
||||
private static final String forgeSpec;
|
||||
private static final String forgeGroup;
|
||||
|
||||
static {
|
||||
String vers = ForgeVersion.class.getPackage().getImplementationVersion();
|
||||
@@ -52,10 +52,19 @@ public class ForgeVersion
|
||||
spec = System.getProperty("forge.spec");
|
||||
}
|
||||
if (spec == null) throw new RuntimeException("Missing forge spec, cannot continue");
|
||||
String group = ForgeVersion.class.getPackage().getImplementationTitle();
|
||||
if (group == null) {
|
||||
group = System.getProperty("forge.group");
|
||||
}
|
||||
if (group == null) {
|
||||
group = "net.minecraftforge"; // If all else fails, Our normal group
|
||||
}
|
||||
forgeVersion = vers;
|
||||
forgeSpec = spec;
|
||||
forgeGroup = group;
|
||||
LOGGER.info(CORE, "Found Forge version {}", forgeVersion);
|
||||
LOGGER.info(CORE, "Found Forge spec {}", forgeSpec);
|
||||
LOGGER.info(CORE, "Found Forge group {}", forgeGroup);
|
||||
}
|
||||
|
||||
public static String getVersion()
|
||||
@@ -77,5 +86,9 @@ public class ForgeVersion
|
||||
public static String getSpec() {
|
||||
return forgeSpec;
|
||||
}
|
||||
|
||||
public static String getGroup() {
|
||||
return forgeGroup;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user