mirror of
https://github.com/MinecraftServerControl/mscs.git
synced 2024-11-15 14:58:18 -07:00
Method to compare two Minecraft version numbers
This commit is contained in:
parent
31901b3dce
commit
7a9608e805
@ -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.
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user