diff --git a/changelog.md b/changelog.md index 26178ba..8f46d4b 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # Changelog +## 1.0.6 +*2021-21-09* +- Fixed pack format ranges being exclusive. + ## 1.0.5 *2021-02-09* - Added flag aliases `h` and `v` for `--help` and `--version` respectively. diff --git a/cli.js b/cli.js index 14acc09..f3f47a7 100644 --- a/cli.js +++ b/cli.js @@ -1,5 +1,5 @@ #!/usr/bin/env node -const VERSION = '1.0.5' +const VERSION = '1.0.6' const getPackFormat = require('./index.js') diff --git a/index.js b/index.js index 387a417..d766203 100644 --- a/index.js +++ b/index.js @@ -21,13 +21,13 @@ function getPackFormat(version) { '17w47b': 3, '19w46b': 4, '20w30a': 5, - '20w45a': 6, + '20w45a': 6, // datapack '22w00a': 7, // current } const snapshot = new Snapshot(version) for (let snap in lastSnapshots) { - if (snapshot.getID() < (new Snapshot(snap)).getID()) { + if (snapshot.getID() <= (new Snapshot(snap)).getID()) { return lastSnapshots[snap] } } @@ -37,6 +37,7 @@ function getPackFormat(version) { // Release // version = version.toLowerCase().replace(' pre-release ', '-pre').replace(' release candidate ', '-rc') + if (version.includes('-')) { if (version.includes('1.16.2-pre')) return 5 else version = version.replace(/-.+$/, '') diff --git a/package.json b/package.json index 944814c..ff7072a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pack-format", - "version": "1.0.5", + "version": "1.0.6", "description": "Returns the pack_format of any Minecraft version, including snapshots", "scripts": { "test": "node test"