Skip to content

Commit

Permalink
1.0.6
Browse files Browse the repository at this point in the history
- Fix ranges being exclusive
  • Loading branch information
Nixinova committed Feb 9, 2021
1 parent 937d57f commit 0799393
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cli.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node
const VERSION = '1.0.5'
const VERSION = '1.0.6'

const getPackFormat = require('./index.js')

Expand Down
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
}
Expand All @@ -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(/-.+$/, '')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 0799393

Please sign in to comment.