minecraft-data 2.119.0 → 2.119.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/doc/history.md +3 -0
- package/index.js +6 -3
- package/package.json +1 -1
- package/test/load.js +6 -0
package/doc/history.md
CHANGED
package/index.js
CHANGED
|
@@ -27,9 +27,12 @@ types.forEach(function (type) {
|
|
|
27
27
|
function Version (type, version, majorVersion) {
|
|
28
28
|
const versions = versionsByMinecraftVersion[type]
|
|
29
29
|
// Allows comparisons against majorVersion even if `other` is not present in the versions.json (e.g. 1.17.0 exists but not 1.17)
|
|
30
|
-
for (const
|
|
31
|
-
const
|
|
32
|
-
|
|
30
|
+
for (const majorMinorPatchVersion in versions) {
|
|
31
|
+
const versionObj = versions[majorMinorPatchVersion]
|
|
32
|
+
// 1.17.0 === 1.17, so let's add explicit logic for that
|
|
33
|
+
if (versionObj.minecraftVersion.endsWith('.0')) {
|
|
34
|
+
versions[versionObj.majorVersion] = versionObj
|
|
35
|
+
}
|
|
33
36
|
}
|
|
34
37
|
|
|
35
38
|
this.dataVersion = versions[version]?.dataVersion
|
package/package.json
CHANGED
package/test/load.js
CHANGED
|
@@ -22,6 +22,12 @@ describe('load', () => {
|
|
|
22
22
|
|
|
23
23
|
const mcData188 = require('minecraft-data')('1.8.8')
|
|
24
24
|
assert.strictEqual(mcData188.isNewerOrEqualTo('1.8'), true, '1.8.8>1.8')
|
|
25
|
+
|
|
26
|
+
const mcDataBedrock1Dot7Dot10 = require('minecraft-data')('bedrock_1.17.10')
|
|
27
|
+
assert.strictEqual(mcDataBedrock1Dot7Dot10.isNewerOrEqualTo('1.17'), true, '1.17.10>1.17')
|
|
28
|
+
|
|
29
|
+
const bedrock16220 = require('minecraft-data')('bedrock_1.16.220')
|
|
30
|
+
assert.strictEqual(bedrock16220.isNewerOrEqualTo('1.16.210'), true, 'bedrock_1.16.220>bedrock_1.16.210')
|
|
25
31
|
})
|
|
26
32
|
})
|
|
27
33
|
|