@spyglassmc/nbt 0.3.40 → 0.3.42

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.
Files changed (2) hide show
  1. package/lib/util.js +9 -1
  2. package/package.json +3 -3
package/lib/util.js CHANGED
@@ -5,6 +5,14 @@ export function localizeTag(type) {
5
5
  export function newSyntax(ctx) {
6
6
  // TODO: don't have this inline java-edition version check
7
7
  const release = ctx.project['loadedVersion'];
8
- return !release || Number(release.slice(2)) >= Number('1.21.5'.slice(2));
8
+ if (!release) {
9
+ return true;
10
+ }
11
+ const [minorA, patchA = 0] = release.slice(2).split('.');
12
+ const [minorB, patchB = 0] = '1.21.5'.slice(2).split('.');
13
+ if (minorA !== minorB) {
14
+ return Number(minorA) >= Number(minorB);
15
+ }
16
+ return Number(patchA) >= Number(patchB);
9
17
  }
10
18
  //# sourceMappingURL=util.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spyglassmc/nbt",
3
- "version": "0.3.40",
3
+ "version": "0.3.42",
4
4
  "type": "module",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -25,8 +25,8 @@
25
25
  "url": "https://github.com/SpyglassMC/Spyglass/issues"
26
26
  },
27
27
  "dependencies": {
28
- "@spyglassmc/core": "0.4.35",
28
+ "@spyglassmc/core": "0.4.36",
29
29
  "@spyglassmc/locales": "0.3.19",
30
- "@spyglassmc/mcdoc": "0.3.39"
30
+ "@spyglassmc/mcdoc": "0.3.40"
31
31
  }
32
32
  }