mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-22 13:09:59 +00:00
Holy Moly, it's a big fat commit of broken code!
This commit is contained in:
1 parent
5b05e103f4
commit
c1f0e1b68f
63 files changed
+2027
-542
No files matched your search
@@ -23,10 +23,15 @@ import static net.minecraftforge.common.ForgeVersion.Status.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -35,6 +40,12 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import com.electronwill.nightconfig.core.Config;
|
||||
import com.electronwill.nightconfig.core.UnmodifiableConfig;
|
||||
import com.electronwill.nightconfig.core.path.PathConfig;
|
||||
import net.minecraftforge.fml.common.versioning.DefaultArtifactVersion;
|
||||
import net.minecraftforge.fml.loading.moddiscovery.ModInfo;
|
||||
import org.apache.logging.log4j.Level;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -57,7 +68,7 @@ public class ForgeVersion
|
||||
//This number is incremented every minecraft release, never reset
|
||||
public static final int minorVersion = 23;
|
||||
//This number is incremented every time a interface changes or new major feature is added, and reset every Minecraft version
|
||||
public static final int revisionVersion = 4;
|
||||
public static final int revisionVersion = 2;
|
||||
//This number is incremented every time Jenkins builds Forge, and never reset. Should always be 0 in the repo code.
|
||||
public static final int buildVersion = 0;
|
||||
// This is the minecraft version we're building for - used in various places in Forge/FML code
|
||||
@@ -69,7 +80,7 @@ public class ForgeVersion
|
||||
@SuppressWarnings("unused")
|
||||
private static String target = null;
|
||||
|
||||
private static final Logger log = LogManager.getLogger(MOD_ID + ".VersionCheck");
|
||||
private static final Logger log = LogManager.getLogger("ForgeVersionCheck");
|
||||
|
||||
private static final int MAX_HTTP_REDIRECTS = Integer.getInteger("http.maxRedirects", 20);
|
||||
|
||||
@@ -110,6 +121,27 @@ public class ForgeVersion
|
||||
return String.format("%d.%d.%d.%d", majorVersion, minorVersion, revisionVersion, buildVersion);
|
||||
}
|
||||
|
||||
public static List<ModInfo> getModInfos()
|
||||
{
|
||||
PathConfig minecraftmod;
|
||||
PathConfig forgemod;
|
||||
try
|
||||
{
|
||||
minecraftmod = PathConfig.of(Paths.get(ForgeVersion.class.getClassLoader().getResource("minecraftmod.toml").toURI()));
|
||||
forgemod = PathConfig.of(Paths.get(ForgeVersion.class.getClassLoader().getResource("forgemod.toml").toURI()));
|
||||
minecraftmod.load();
|
||||
forgemod.load();
|
||||
}
|
||||
catch (URISyntaxException | NullPointerException e)
|
||||
{
|
||||
throw new RuntimeException("Missing toml configs for minecraft and forge!", e);
|
||||
}
|
||||
return Arrays.asList(
|
||||
new ModInfo(null, minecraftmod),
|
||||
new ModInfo(null, forgemod)
|
||||
);
|
||||
}
|
||||
|
||||
public static enum Status
|
||||
{
|
||||
PENDING(),
|
||||
|
||||
Reference in new issue
Block a user