@spyglassmc/nbt 0.3.27 → 0.3.29

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.
@@ -13,7 +13,7 @@ const collection = (node, ctx) => {
13
13
  ...ctx,
14
14
  requireCanonical: node.requireCanonical,
15
15
  });
16
- if (ctx.offset < node.children[node.children.length - 1]?.range.start ?? 0) {
16
+ if (ctx.offset < (node.children[node.children.length - 1]?.range.start ?? 0)) {
17
17
  return completions.map(c => ({ ...c, insertText: c.insertText + ',' }));
18
18
  }
19
19
  return completions;
@@ -16,9 +16,13 @@ export const list = (src, ctx) => {
16
16
  ans.valueType = ans.children[0]?.value?.type;
17
17
  // Check if every element is of the same type.
18
18
  if (ans.valueType) {
19
- for (const { value } of ans.children) {
20
- if (value && value.type !== ans.valueType) {
21
- ctx.err.report(localize('expected-got', localizeTag(ans.valueType), localizeTag(value.type)), value);
19
+ // TODO: don't have this inline java-edition version check
20
+ const release = ctx.project['loadedVersion'];
21
+ if (release && Number(release.slice(2)) < Number('1.21.5'.slice(2))) {
22
+ for (const { value } of ans.children) {
23
+ if (value && value.type !== ans.valueType) {
24
+ ctx.err.report(localize('expected-got', localizeTag(ans.valueType), localizeTag(value.type)), value);
25
+ }
22
26
  }
23
27
  }
24
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spyglassmc/nbt",
3
- "version": "0.3.27",
3
+ "version": "0.3.29",
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.23",
28
+ "@spyglassmc/core": "0.4.24",
29
29
  "@spyglassmc/locales": "0.3.12",
30
- "@spyglassmc/mcdoc": "0.3.27"
30
+ "@spyglassmc/mcdoc": "0.3.28"
31
31
  }
32
32
  }