Method to compare two Minecraft version numbers

This commit is contained in:
Jason M. Wood 2014-09-16 13:32:47 -06:00
parent 31901b3dce
commit 7a9608e805

View File

@ -390,6 +390,20 @@ compareTime() {
echo $(($T1 < $T2 ? -1 : $T1 > $T2 ? 1 : 0))
}
# ---------------------------------------------------------------------------
# Compare two Minecraft version numbers.
#
# @param 1 The first Minecraft version number.
# @param 2 The second Minecraft version number.
# @return The result of the comparison: -1, 0, 1.
# ---------------------------------------------------------------------------
compareMinecraftVersions() {
local T1 T2
T1=$(getMinecraftVersionReleaseTime "$1")
T2=$(getMinecraftVersionReleaseTime "$2")
compareTime "$T1" "$T2"
}
# ---------------------------------------------------------------------------
# Create a world.
#