Skip to content

Commit e19f197

Browse files
committed
Update pack formats, plus decimal support
1 parent 2e3790b commit e19f197

File tree

5 files changed

+19
-8
lines changed

5 files changed

+19
-8
lines changed

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## Next
4+
- Changed CLI parsing to support decimal pack formats.
5+
- Updated resource pack format to `65.2`.
6+
- Updated data pack format to `83.0`.
7+
38
## 1.4.2
49
*2025-06-27*
510
- Fixed returned latest pack formats not checking release versions.

src/cli.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ else if (args.list) {
8383
else if (Number.isNaN(ver)) {
8484
console.error(`'${ver}' is not a valid pack format`)
8585
}
86-
else if (!/^\d+$/.test(ver)) {
87-
console.error(`'${ver}' is a version number, not a pack format`)
88-
}
8986
else {
9087
const type = args.data ? 'data' : 'resource'
9188
const vers = getVersions(+ver, type)

src/index.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { VersionName, SnapshotName, PackType, FormatResult, VersionsResult } fro
99
const HIGHEST_MINORS: number[] = [
1010
/*1.0*/0, /*1.1*/0, /*1.2*/5, /*1.3*/2, /*1.4*/7, /*1.5*/2, /*1.6*/4, /*1.7*/10, /*1.8*/9, /*1.9*/4,
1111
/*1.10*/2, /*1.11*/2, /*1.12*/2, /*1.13*/2, /*1.14*/4, /*1.15*/2, /*1.16*/5, /*1.17*/1, /*1.18*/2, /*1.19*/2,
12-
/*1.20*/6, /*1.21*/5,
12+
/*1.20*/6, /*1.21*/8,
1313
]
1414

1515
const START_RELEASES: Record<VersionName, Record<PackType, FormatResult>> = {
@@ -37,8 +37,9 @@ const START_RELEASES: Record<VersionName, Record<PackType, FormatResult>> = {
3737
'1.21.5': { resource: 55, data: 71 },
3838
'1.21.6': { resource: 63, data: 80 },
3939
'1.21.7': { resource: 64, data: 81 },
40+
'1.21.8': { resource: 64, data: 81 },
4041
// future versions: return undefined
41-
'1.21.8': { resource: undefined, data: undefined },
42+
'1.21.9': { resource: undefined, data: undefined },
4243
'1.22.x': { resource: undefined, data: undefined },
4344
}
4445
const START_SNAPSHOTS: Record<string, Record<PackType, FormatResult>> = {
@@ -113,9 +114,12 @@ const START_SNAPSHOTS: Record<string, Record<PackType, FormatResult>> = {
113114
'25w19a': { resource: 60, data: 76 },
114115
'25w20a': { resource: 61, data: 77 },
115116
'25w21a': { resource: 62, data: 78 },
117+
'25w31a': { resource: 65.0, data: 82.0 },
118+
'25w32a': { resource: 65.1, data: 83.0 },
119+
'25w33a': { resource: 65.2, data: 83.1 },
116120

117121
// The below should be the last released snapshot + 1 week
118-
['25w26a']: { resource: undefined, data: undefined },
122+
['25w34a']: { resource: undefined, data: undefined },
119123
}
120124

121125
const SPECIAL: Record<PackType, Record<number, string[]>> = {

test/pack-formats-tests.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ Types:
5151
"1.21.5" (r,d) 55,71
5252
"1.21.6" (r,d) 63,80
5353
"1.21.7" (r,d) 64,81
54-
"1.21.8" (r) none
54+
"1.21.8" (r,d) 64,81
55+
"1.21.9" (r) none
5556
"1.22" (d) none
5657

5758
=== Pre-releases ===
@@ -99,6 +100,7 @@ Types:
99100
"1.21.6-rc1" (r,d) 63,80
100101
"1.21.7-rc1" (r,d) 63,80
101102
"1.21.7-rc2" (r,d) 64,81
103+
"1.21.8-rc1" (r,d) 64,81
102104

103105
=== Snapshots ===
104106

@@ -175,6 +177,9 @@ Types:
175177
"25w19a" (r,d) 60,76
176178
"25w20a" (r,d) 61,77
177179
"25w21a" (r,d) 62,78
180+
"25w31a" (r,d) 65.0,82.0
181+
"25w32a" (r,d) 65.1,83.0
182+
"25w33a" (r,d) 65.2,83.1
178183

179184
=== Special cases ===
180185

test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function testVersions([input, type], expected) {
3434
function testPackFormats() {
3535
const formatsTests = fs.readFileSync(path.join(__dirname, 'pack-formats-tests.txt'), { 'encoding': 'utf-8' })
3636
for (const line of formatsTests.split('\n')) {
37-
const parts = line.match(/^"(.*)" \((r|d|r,d|-)\) (\w+(?:,\w+)?)/)
37+
const parts = line.match(/^"(.*)" \((r|d|r,d|-)\) ([\w.]+(?:,[\w.]+)?)/)
3838
if (!parts)
3939
continue
4040

0 commit comments

Comments
 (0)