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 CHANGED
@@ -1,3 +1,6 @@
1
+ ## 2.119.1
2
+ * Alias versions that end in .0 to a version without the ending .0
3
+
1
4
  ## 2.119.0
2
5
  * update mcdata
3
6
 
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 version in versions) {
31
- const ver = versions[version]
32
- versions[ver.majorVersion] = versions[ver.majorVersion] || ver
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "minecraft-data",
3
- "version": "2.119.0",
3
+ "version": "2.119.1",
4
4
  "description": "Provide easy access to minecraft data in node.js",
5
5
  "main": "index.js",
6
6
  "tonicExampleFilename": "example.js",
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