Closed xpple closed 2 months ago
I think I have garnered enough downvotes to close the PR 🤣. Though, I am under the sincere impression this could be very useful for when the loader has to decide which version of a library included by multiple mods it should use. In that case there would be no risk of any problems due to internet unavailability, as it would just defaults back to string comparison as it used to.
This PR proposes the addition of a new method to compare version strings that are commit hashes. It is very common for snapshot releases to set their version to the commit hash. Before they were not comparable, and would just use
String#compare
instead, which is completely arbitrary.The comparison is done by extracting the commit metadata from GitHub's API. For this it must be the case that a
sources
entry is present in thecontact
object of thefabric.mod.json
, and that it is set before the JSON reader reaches theversion
entry. Mod developers would have to be made aware of this. Note that due to the nature of this comparison, it will not be available when not connected to the internet.