Class ModBuildInfo

java.lang.Object
me.tamkungz.nilkit.build.ModBuildInfo

public final class ModBuildInfo extends Object
Represents metadata information about a mod build.

This class is intended to replace hardcoded build tags across the codebase. Kept in source control so clean CI environments can compile without generated sources.

Example usage:

 ModBuildInfo build = new ModBuildInfo.Builder("NilKit")
     .version("1.0.0")
     .gameVersion("1.4.7")
     .buildDate("20260321")
     .build();

 log.info("Loaded: " + build.getBuildTag());
 // → "NilKit-1.4.7-20260321"
 
  • Method Details

    • getModId

      public String getModId()
      Returns:
      the mod identifier
    • getVersion

      public String getVersion()
      Returns:
      the mod version
    • getGameVersion

      public String getGameVersion()
      Returns:
      the target game version
    • getBuildDate

      public String getBuildDate()
      Returns:
      the build date (typically in YYYYMMDD format)
    • getBuildTag

      public String getBuildTag()
      Returns a formatted build tag in the form:
       ModId-gameVersion-buildDate[-extra]
       
      Example:
       LYFE-1.4.7-20260321
       
      Returns:
      the build tag string
    • toLogLine

      public String toLogLine()
      Returns a formatted log line.

      Format:

       [ModId] v1.0.0 | game=1.4.7 | build=20260321
       
      Returns:
      a human-readable log string
    • toString

      public String toString()
      Returns the build tag representation of this object.
      Overrides:
      toString in class Object
      Returns:
      the build tag string
    • fromNilMetadata

      public static ModBuildInfo fromNilMetadata(nilloader.api.NilMetadata metadata)
      Creates a ModBuildInfo instance directly from NilMetadata.
      Parameters:
      metadata - the NilLoader metadata source
      Returns:
      a new ModBuildInfo instance