Package me.tamkungz.nilkit.build
Class ModBuildInfo
java.lang.Object
me.tamkungz.nilkit.build.ModBuildInfo
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"
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ModBuildInfofromNilMetadata(nilloader.api.NilMetadata metadata) Creates aModBuildInfoinstance directly fromNilMetadata.Returns a formatted build tag in the form:getModId()Returns a formatted log line.toString()Returns the build tag representation of this object.
-
Method Details
-
getModId
- Returns:
- the mod identifier
-
getVersion
- Returns:
- the mod version
-
getGameVersion
- Returns:
- the target game version
-
getBuildDate
- Returns:
- the build date (typically in YYYYMMDD format)
-
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
Returns a formatted log line.Format:
[ModId] v1.0.0 | game=1.4.7 | build=20260321
- Returns:
- a human-readable log string
-
toString
Returns the build tag representation of this object. -
fromNilMetadata
Creates aModBuildInfoinstance directly fromNilMetadata.- Parameters:
metadata- the NilLoader metadata source- Returns:
- a new
ModBuildInfoinstance
-