mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-25 14:34:28 +00:00
Cleanup usages of static imports and build script so that our build doesn't spam useless error like messages.
So that it is easier to see real errors. Add compatibility checking to standard testing tasks.
This commit is contained in:
28 files changed
+202
-258
No files matched your search
@@ -5,6 +5,7 @@
|
||||
|
||||
package net.minecraftforge.versions.forge;
|
||||
|
||||
import net.minecraftforge.fml.Logging;
|
||||
import net.minecraftforge.fml.ModList;
|
||||
import net.minecraftforge.fml.VersionChecker;
|
||||
import net.minecraftforge.fml.loading.FMLLoader;
|
||||
@@ -13,8 +14,6 @@ import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import static net.minecraftforge.fml.Logging.CORE;
|
||||
|
||||
public class ForgeVersion
|
||||
{
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
@@ -26,7 +25,7 @@ public class ForgeVersion
|
||||
private static final String forgeGroup;
|
||||
|
||||
static {
|
||||
LOGGER.debug(CORE, "Forge Version package {} from {}", ForgeVersion.class.getPackage(), ForgeVersion.class.getClassLoader());
|
||||
LOGGER.debug(Logging.CORE, "Forge Version package {} from {}", ForgeVersion.class.getPackage(), ForgeVersion.class.getClassLoader());
|
||||
String vers = JarVersionLookupHandler.getImplementationVersion(ForgeVersion.class).orElse(FMLLoader.versionInfo().forgeVersion());
|
||||
if (vers == null) throw new RuntimeException("Missing forge version, cannot continue");
|
||||
String spec = JarVersionLookupHandler.getSpecificationVersion(ForgeVersion.class).orElse(System.getenv("FORGE_SPEC"));
|
||||
@@ -38,9 +37,9 @@ public class ForgeVersion
|
||||
forgeVersion = vers;
|
||||
forgeSpec = spec;
|
||||
forgeGroup = group;
|
||||
LOGGER.debug(CORE, "Found Forge version {}", forgeVersion);
|
||||
LOGGER.debug(CORE, "Found Forge spec {}", forgeSpec);
|
||||
LOGGER.debug(CORE, "Found Forge group {}", forgeGroup);
|
||||
LOGGER.debug(Logging.CORE, "Found Forge version {}", forgeVersion);
|
||||
LOGGER.debug(Logging.CORE, "Found Forge spec {}", forgeSpec);
|
||||
LOGGER.debug(Logging.CORE, "Found Forge group {}", forgeGroup);
|
||||
}
|
||||
|
||||
public static String getVersion()
|
||||
|
||||
@@ -8,25 +8,24 @@ package net.minecraftforge.versions.mcp;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import net.minecraftforge.fml.Logging;
|
||||
import net.minecraftforge.fml.loading.FMLLoader;
|
||||
import net.minecraftforge.fml.loading.JarVersionLookupHandler;
|
||||
|
||||
import static net.minecraftforge.fml.Logging.CORE;
|
||||
|
||||
public class MCPVersion {
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
private static final String mcVersion;
|
||||
private static final String mcpVersion;
|
||||
static {
|
||||
LOGGER.debug(CORE, "MCP Version package {} from {}", MCPVersion.class.getPackage(), MCPVersion.class.getClassLoader());
|
||||
LOGGER.debug(Logging.CORE, "MCP Version package {} from {}", MCPVersion.class.getPackage(), MCPVersion.class.getClassLoader());
|
||||
mcVersion = JarVersionLookupHandler.getSpecificationVersion(MCPVersion.class).orElse(FMLLoader.versionInfo().mcVersion());
|
||||
if (mcVersion == null) throw new RuntimeException("Missing MC version, cannot continue");
|
||||
|
||||
mcpVersion = JarVersionLookupHandler.getImplementationVersion(MCPVersion.class).orElse(FMLLoader.versionInfo().mcpVersion());
|
||||
if (mcpVersion == null) throw new RuntimeException("Missing MCP version, cannot continue");
|
||||
|
||||
LOGGER.debug(CORE, "Found MC version information {}", mcVersion);
|
||||
LOGGER.debug(CORE, "Found MCP version information {}", mcpVersion);
|
||||
LOGGER.debug(Logging.CORE, "Found MC version information {}", mcVersion);
|
||||
LOGGER.debug(Logging.CORE, "Found MCP version information {}", mcpVersion);
|
||||
}
|
||||
public static String getMCVersion() {
|
||||
return mcVersion;
|
||||
|
||||
Reference in new issue
Block a user