Class ForgeVersion

java.lang.Object
net.minecraftforge.versions.forge.ForgeVersion

public class ForgeVersion
extends Object
Holds the version information for Minecraft Forge.
  • Field Summary

    Fields
    Modifier and Type Field Description
    static String MOD_ID  
  • Constructor Summary

    Constructors
    Constructor Description
    ForgeVersion()  
  • Method Summary

    Modifier and Type Method Description
    static String getGroup()
    Returns the group of the currently running Minecraft Forge implementation.
    static String getSpec()
    Returns the current specification version of Forge Mod Loader.
    static net.minecraftforge.fml.VersionChecker.Status getStatus()
    Returns the VersionChecker.Status for the Forge mod.
    static String getTarget()
    Returns the more up-to-date version found by the VersionChecker, or a blank string if none is found.
    static String getVersion()
    Returns the current implementation version of Minecraft Forge.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ForgeVersion

      public ForgeVersion()
  • Method Details

    • getVersion

      public static String getVersion()
      Returns the current implementation version of Minecraft Forge.

      This is retrieved from the Implementation-Version from the manifest of the JAR where this class resides in. If that does not exist, then the version is taken from the FORGE_VERSION System.getenv(String) environment variable} (If those do not exist, then a RuntimeException will be thrown).

      Returns:
      The implementation version of Minecraft Forge
    • getStatus

      public static net.minecraftforge.fml.VersionChecker.Status getStatus()
      Returns the VersionChecker.Status for the Forge mod.
      Returns:
      The version checker status for the Forge mod
    • getTarget

      @Nullable public static String getTarget()
      Returns the more up-to-date version found by the VersionChecker, or a blank string if none is found.
      Returns:
      The more up-to-date remote version, or a blank string
    • getSpec

      public static String getSpec()
      Returns the current specification version of Forge Mod Loader.

      This is retrieved from the Specification-Version from the manifest of the JAR where this class resides in. If that does not exist, then the version is taken from the FORGE_SPEC environment variable (If those do not exist, then a RuntimeException will be thrown).

      Returns:
      The specification version of Minecraft forge
    • getGroup

      public static String getGroup()
      Returns the group of the currently running Minecraft Forge implementation.

      This is retrieved from the Implementation-Title from the manifest of the JAR where this class resides in. If that does not exist, then the version is taken from the FORGE_GROUP environment variable. If those do not exist, then the group will default to net.minecraftforge.

      Returns:
      The group for the running Minecraft Forge implementation