testVersion

abstract fun testVersion(id: String, version: String): Optional<Int>

Tests the version of the provided mod (or minecraft)

Return

Optional - The resulting version comparison. If the comparison isn't valid for some reason (or the id isn't loaded) the optional will be empty, otherwise will be the result of a Comparator check (negative = loaded version less than the requested version, 0 = versions functionally equal, positive = loaded version is higher).

Author

fzzyhmstrs

Since

0.6.3

Parameters

id

String - the modid to test the version of. Use "minecraft" to test MCs loaded version

version

String representation of the version to test. Example "0.6.3". The loaders may have individual quirks when it comes to parsing the result