Record Class VersionInfo

java.lang.Object
java.lang.Record
net.minecraftforge.fml.loading.VersionInfo

public record VersionInfo(String forgeVersion, String mcVersion, String mcpVersion, String forgeGroup) extends Record
TODO: [FML][Loader] Remove VersionInfo - we shouldn't need to base any decisions on forge or mc version info at the loader level. So once I get a proper replacement i'm gunna kill this.
  • Field Details

    • forgeVersion

      private final String forgeVersion
      The field for the forgeVersion record component.
    • mcVersion

      private final String mcVersion
      The field for the mcVersion record component.
    • mcpVersion

      private final String mcpVersion
      The field for the mcpVersion record component.
    • forgeGroup

      private final String forgeGroup
      The field for the forgeGroup record component.
    • GSON

      private static final com.google.gson.Gson GSON
  • Constructor Details

    • VersionInfo

      public VersionInfo(String forgeVersion, String mcVersion, String mcpVersion, String forgeGroup)
      Creates an instance of a VersionInfo record class.
      Parameters:
      forgeVersion - the value for the forgeVersion record component
      mcVersion - the value for the mcVersion record component
      mcpVersion - the value for the mcpVersion record component
      forgeGroup - the value for the forgeGroup record component
  • Method Details

    • mcAndForgeVersion

      public String mcAndForgeVersion()
    • mcAndMCPVersion

      public String mcAndMCPVersion()
    • readJson

      private static <T> T readJson(String path, Class<T> type)
    • detect

      static VersionInfo detect()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • forgeVersion

      public String forgeVersion()
      Returns the value of the forgeVersion record component.
      Returns:
      the value of the forgeVersion record component
    • mcVersion

      public String mcVersion()
      Returns the value of the mcVersion record component.
      Returns:
      the value of the mcVersion record component
    • mcpVersion

      public String mcpVersion()
      Returns the value of the mcpVersion record component.
      Returns:
      the value of the mcpVersion record component
    • forgeGroup

      public String forgeGroup()
      Returns the value of the forgeGroup record component.
      Returns:
      the value of the forgeGroup record component