mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 10:44:55 -05:00
um add this util which prob gonna be used in the future
This commit is contained in:
parent
f02784a9fc
commit
e0d29d0d9e
1 changed files with 12 additions and 0 deletions
12
util/minecraftVersionToNumber.js
Normal file
12
util/minecraftVersionToNumber.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
/**
|
||||
* converts minecraft version to number (for example '1.19.2' will be 1.19)
|
||||
* @param {String} version
|
||||
* @return {Number} decimal number of the version you specified
|
||||
*/
|
||||
function minecraftVersionToNumber (version) {
|
||||
const versionArray = version.split('.')
|
||||
versionArray.pop()
|
||||
return Number(versionArray.join('.'))
|
||||
}
|
||||
|
||||
module.exports = minecraftVersionToNumber
|
Loading…
Reference in a new issue