@spyglassmc/java-edition 0.1.0 → 0.1.3

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 (49) hide show
  1. package/lib/binder/index.d.ts +3 -3
  2. package/lib/binder/index.js +2 -2
  3. package/lib/common/index.js +5 -1
  4. package/lib/dependency/common.d.ts +8 -5
  5. package/lib/dependency/common.js +15 -12
  6. package/lib/dependency/index.d.ts +1 -1
  7. package/lib/dependency/index.js +11 -7
  8. package/lib/dependency/mcmeta.d.ts +1 -2
  9. package/lib/dependency/mcmeta.js +27 -70
  10. package/lib/index.js +21 -5
  11. package/lib/json/checker/data/common.d.ts +1 -1
  12. package/lib/json/checker/data/index.d.ts +1 -1
  13. package/lib/json/checker/data/tag.js +1 -1
  14. package/lib/json/checker/util/block_states.js +5 -1
  15. package/lib/json/checker/util/index.js +5 -1
  16. package/lib/json/checker/util/nbt.d.ts +1 -2
  17. package/lib/json/checker/util/version.d.ts +12 -12
  18. package/lib/json/checker/util/version.js +1 -1
  19. package/lib/json/index.js +5 -1
  20. package/lib/mcfunction/checker/index.js +108 -26
  21. package/lib/mcfunction/colorizer/index.js +5 -1
  22. package/lib/mcfunction/common/index.js +5 -1
  23. package/lib/mcfunction/completer/argument.js +10 -6
  24. package/lib/mcfunction/completer/index.js +5 -1
  25. package/lib/mcfunction/index.d.ts +2 -2
  26. package/lib/mcfunction/index.js +13 -22
  27. package/lib/mcfunction/inlayHintProvider.js +5 -1
  28. package/lib/mcfunction/node/argument.d.ts +3 -1
  29. package/lib/mcfunction/node/argument.js +23 -11
  30. package/lib/mcfunction/node/index.js +5 -1
  31. package/lib/mcfunction/parser/argument.d.ts +2 -1
  32. package/lib/mcfunction/parser/argument.js +14 -10
  33. package/lib/mcfunction/parser/index.js +5 -1
  34. package/lib/mcfunction/signatureHelpProvider.js +5 -1
  35. package/lib/mcfunction/tree/index.d.ts +0 -5
  36. package/lib/mcfunction/tree/index.js +5 -6
  37. package/lib/mcfunction/tree/patch.d.ts +4 -0
  38. package/lib/mcfunction/tree/patch.js +752 -0
  39. package/package.json +7 -7
  40. package/lib/mcfunction/tree/1.15.d.ts +0 -9
  41. package/lib/mcfunction/tree/1.15.js +0 -542
  42. package/lib/mcfunction/tree/1.16.d.ts +0 -10
  43. package/lib/mcfunction/tree/1.16.js +0 -77
  44. package/lib/mcfunction/tree/1.17.d.ts +0 -12
  45. package/lib/mcfunction/tree/1.17.js +0 -166
  46. package/lib/mcfunction/tree/1.18.d.ts +0 -26
  47. package/lib/mcfunction/tree/1.18.js +0 -6
  48. package/lib/mcfunction/tree/1.19.d.ts +0 -26
  49. package/lib/mcfunction/tree/1.19.js +0 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spyglassmc/java-edition",
3
- "version": "0.1.0",
3
+ "version": "0.1.3",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "SPGoding",
@@ -16,12 +16,12 @@
16
16
  "release:dry": "npm publish --dry-run"
17
17
  },
18
18
  "dependencies": {
19
- "@spyglassmc/core": "0.1.0",
20
- "@spyglassmc/json": "0.1.0",
21
- "@spyglassmc/locales": "0.1.0",
22
- "@spyglassmc/mcfunction": "0.1.0",
23
- "@spyglassmc/nbt": "0.1.0",
24
- "@spyglassmc/nbtdoc": "0.1.0"
19
+ "@spyglassmc/core": "0.1.2",
20
+ "@spyglassmc/json": "0.1.2",
21
+ "@spyglassmc/locales": "0.1.2",
22
+ "@spyglassmc/mcfunction": "0.1.2",
23
+ "@spyglassmc/mcdoc": "0.1.1",
24
+ "@spyglassmc/nbt": "0.1.3"
25
25
  },
26
26
  "devDependencies": {
27
27
  "fast-glob": "^3.2.5",
@@ -1,9 +0,0 @@
1
- import type { PartialRootTreeNode } from '@spyglassmc/mcfunction';
2
- /**
3
- * Patch for Minecraft: Java Edition 1.15.2
4
- *
5
- * The following parsers are patched with new properties:
6
- * - `minecraft:resource_location`
7
- */
8
- export declare const Tree1_15: PartialRootTreeNode;
9
- //# sourceMappingURL=1.15.d.ts.map
@@ -1,542 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Tree1_15 = void 0;
4
- const AdvancementTargets = {
5
- children: {
6
- targets: {
7
- children: {
8
- from: {
9
- children: {
10
- advancement: {
11
- properties: {
12
- category: 'advancement',
13
- },
14
- },
15
- },
16
- },
17
- only: {
18
- children: {
19
- advancement: {
20
- properties: {
21
- category: 'advancement',
22
- },
23
- },
24
- },
25
- },
26
- through: {
27
- children: {
28
- advancement: {
29
- properties: {
30
- category: 'advancement',
31
- },
32
- },
33
- },
34
- },
35
- until: {
36
- children: {
37
- advancement: {
38
- properties: {
39
- category: 'advancement',
40
- },
41
- },
42
- },
43
- },
44
- },
45
- },
46
- },
47
- };
48
- const DataSource = {
49
- children: {
50
- storage: {
51
- children: {
52
- source: {
53
- properties: {
54
- category: 'storage',
55
- },
56
- },
57
- },
58
- },
59
- },
60
- };
61
- const DataTarget = {
62
- children: {
63
- storage: {
64
- children: {
65
- target: {
66
- properties: {
67
- category: 'storage',
68
- accessType: 1 /* Write */,
69
- },
70
- },
71
- },
72
- },
73
- },
74
- };
75
- const DataModifySource = {
76
- children: {
77
- from: DataSource,
78
- },
79
- };
80
- const DataModifyOperation = {
81
- children: {
82
- append: DataModifySource,
83
- insert: {
84
- children: {
85
- index: DataModifySource,
86
- },
87
- },
88
- merge: DataModifySource,
89
- prepend: DataModifySource,
90
- set: DataModifySource,
91
- },
92
- };
93
- const ExecuteCondition = {
94
- children: {
95
- data: DataSource,
96
- predicate: {
97
- children: {
98
- predicate: {
99
- properties: {
100
- category: 'predicate',
101
- },
102
- },
103
- },
104
- },
105
- },
106
- };
107
- const ExecuteStoreTarget = {
108
- children: {
109
- ...DataTarget.children,
110
- bossbar: {
111
- children: {
112
- id: {
113
- properties: {
114
- category: 'bossbar',
115
- accessType: 1 /* Write */,
116
- },
117
- },
118
- },
119
- },
120
- },
121
- };
122
- const LootSource = {
123
- children: {
124
- fish: {
125
- children: {
126
- loot_table: {
127
- properties: {
128
- category: 'loot_table',
129
- },
130
- },
131
- },
132
- },
133
- loot: {
134
- children: {
135
- loot_table: {
136
- properties: {
137
- category: 'loot_table',
138
- },
139
- },
140
- },
141
- },
142
- },
143
- };
144
- const ObjectiveWriteTargets = {
145
- children: {
146
- targets: {
147
- children: {
148
- objective: {
149
- properties: {
150
- accessType: 1 /* Write */,
151
- },
152
- },
153
- },
154
- },
155
- },
156
- };
157
- const RecipeTargets = {
158
- children: {
159
- targets: {
160
- children: {
161
- recipe: {
162
- properties: {
163
- category: 'recipe',
164
- },
165
- },
166
- },
167
- },
168
- },
169
- };
170
- const Sound = {
171
- children: {
172
- sound: {
173
- properties: {
174
- category: 'sound_event',
175
- },
176
- },
177
- },
178
- };
179
- /**
180
- * Patch for Minecraft: Java Edition 1.15.2
181
- *
182
- * The following parsers are patched with new properties:
183
- * - `minecraft:resource_location`
184
- */
185
- exports.Tree1_15 = {
186
- children: {
187
- advancement: {
188
- children: {
189
- grant: AdvancementTargets,
190
- revoke: AdvancementTargets,
191
- },
192
- },
193
- ban: {
194
- permission: 3,
195
- },
196
- 'ban-ip': {
197
- permission: 3,
198
- },
199
- banlist: {
200
- permission: 3,
201
- },
202
- bossbar: {
203
- children: {
204
- add: {
205
- children: {
206
- id: {
207
- properties: {
208
- category: 'bossbar',
209
- usageType: 'definition',
210
- },
211
- },
212
- },
213
- },
214
- get: {
215
- children: {
216
- id: {
217
- properties: {
218
- category: 'bossbar',
219
- },
220
- },
221
- },
222
- },
223
- remove: {
224
- children: {
225
- id: {
226
- properties: {
227
- category: 'bossbar',
228
- },
229
- },
230
- },
231
- },
232
- set: {
233
- children: {
234
- id: {
235
- properties: {
236
- category: 'bossbar',
237
- accessType: 1 /* Write */,
238
- },
239
- },
240
- },
241
- },
242
- },
243
- },
244
- data: {
245
- children: {
246
- get: DataSource,
247
- merge: DataTarget,
248
- modify: {
249
- children: {
250
- block: {
251
- children: {
252
- targetPos: {
253
- children: {
254
- targetPath: DataModifyOperation,
255
- },
256
- },
257
- },
258
- },
259
- entity: {
260
- children: {
261
- target: {
262
- children: {
263
- targetPath: DataModifyOperation,
264
- },
265
- },
266
- },
267
- },
268
- storage: {
269
- children: {
270
- target: {
271
- properties: {
272
- category: 'storage',
273
- accessType: 1 /* Write */,
274
- },
275
- children: {
276
- targetPath: DataModifyOperation,
277
- },
278
- },
279
- },
280
- },
281
- },
282
- },
283
- remove: DataSource,
284
- },
285
- },
286
- debug: {
287
- permission: 3,
288
- },
289
- deop: {
290
- permission: 3,
291
- },
292
- execute: {
293
- children: {
294
- if: ExecuteCondition,
295
- store: {
296
- children: {
297
- result: ExecuteStoreTarget,
298
- success: ExecuteStoreTarget,
299
- },
300
- },
301
- unless: ExecuteCondition,
302
- },
303
- },
304
- help: {
305
- permission: 0,
306
- },
307
- kick: {
308
- permission: 3,
309
- },
310
- list: {
311
- permission: 0,
312
- },
313
- loot: {
314
- children: {
315
- give: {
316
- children: {
317
- players: LootSource,
318
- },
319
- },
320
- insert: {
321
- children: {
322
- targetPos: LootSource,
323
- },
324
- },
325
- replace: {
326
- children: {
327
- block: {
328
- children: {
329
- targetPos: {
330
- children: {
331
- slot: {
332
- children: {
333
- ...LootSource.children,
334
- count: LootSource,
335
- },
336
- },
337
- },
338
- },
339
- },
340
- },
341
- entity: {
342
- children: {
343
- entities: {
344
- children: {
345
- slot: {
346
- children: {
347
- ...LootSource.children,
348
- count: LootSource,
349
- },
350
- },
351
- },
352
- },
353
- },
354
- },
355
- },
356
- },
357
- spawn: {
358
- children: {
359
- targetPos: LootSource,
360
- },
361
- },
362
- },
363
- },
364
- me: {
365
- permission: 0,
366
- },
367
- msg: {
368
- permission: 0,
369
- },
370
- op: {
371
- permission: 3,
372
- },
373
- pardon: {
374
- permission: 3,
375
- },
376
- 'pardon-ip': {
377
- permission: 3,
378
- },
379
- playsound: Sound,
380
- publish: {
381
- permission: 4,
382
- },
383
- recipe: {
384
- children: {
385
- give: RecipeTargets,
386
- take: RecipeTargets,
387
- },
388
- },
389
- 'save-all': {
390
- permission: 4,
391
- },
392
- 'save-off': {
393
- permission: 4,
394
- },
395
- 'save-on': {
396
- permission: 4,
397
- },
398
- scoreboard: {
399
- children: {
400
- objectives: {
401
- children: {
402
- add: {
403
- children: {
404
- objective: {
405
- parser: 'minecraft:objective',
406
- properties: {
407
- usageType: 'definition',
408
- },
409
- },
410
- },
411
- },
412
- },
413
- },
414
- players: {
415
- children: {
416
- add: ObjectiveWriteTargets,
417
- operation: ObjectiveWriteTargets,
418
- remove: ObjectiveWriteTargets,
419
- reset: ObjectiveWriteTargets,
420
- set: ObjectiveWriteTargets,
421
- },
422
- },
423
- },
424
- },
425
- setidletimeout: {
426
- permission: 3,
427
- },
428
- stop: {
429
- permission: 4,
430
- },
431
- stopsound: {
432
- children: {
433
- targets: {
434
- children: {
435
- '*': Sound,
436
- ambient: Sound,
437
- block: Sound,
438
- hostile: Sound,
439
- master: Sound,
440
- music: Sound,
441
- neutral: Sound,
442
- player: Sound,
443
- record: Sound,
444
- voice: Sound,
445
- weather: Sound,
446
- },
447
- },
448
- },
449
- },
450
- tag: {
451
- children: {
452
- targets: {
453
- children: {
454
- add: {
455
- children: {
456
- name: {
457
- parser: 'spyglassmc:tag',
458
- },
459
- },
460
- },
461
- remove: {
462
- children: {
463
- name: {
464
- parser: 'spyglassmc:tag',
465
- },
466
- },
467
- },
468
- },
469
- },
470
- },
471
- },
472
- team: {
473
- children: {
474
- add: {
475
- children: {
476
- team: {
477
- parser: 'minecraft:team',
478
- properties: {
479
- usageType: 'definition',
480
- },
481
- },
482
- },
483
- },
484
- },
485
- },
486
- teammsg: {
487
- permission: 0,
488
- },
489
- /**
490
- * Original command syntax:
491
- * 1. `teleport <destination: entity(single)>`
492
- * 2. `teleport <location: vec3>`
493
- * 3. `teleport <targets: entity(multiple)> <...arguments>`
494
- *
495
- * It is impossible for Spyglass to differentiate between (1) and (3) when it encouters a single entity
496
- * at the position of the first argument, due to its lack of ability to backtrack.
497
- *
498
- * Therefore, we have compromised to patch the trees to something like this:
499
- * - `teleport <location: vec3>`
500
- * - `teleport <targets: entity(multiple)> [<...arguments>]`
501
- *
502
- * Diff:
503
- * - Removed (1) `teleport <destination: entity(single)>`.
504
- * - Marked `<...arguments>` in (3) as optional.
505
- *
506
- * The downside of this patch is that entity selectors tracking multiple entities can now be used as the
507
- * `<destination>` argument. We will see how this work.
508
- */
509
- teleport: {
510
- children: {
511
- destination: undefined,
512
- targets: {
513
- executable: true,
514
- },
515
- },
516
- },
517
- tell: {
518
- permission: 0,
519
- },
520
- tm: {
521
- permission: 0,
522
- },
523
- trigger: {
524
- permission: 0,
525
- children: {
526
- objective: {
527
- properties: {
528
- category: 'objective',
529
- accessType: 1 /* Write */,
530
- },
531
- },
532
- },
533
- },
534
- w: {
535
- permission: 0,
536
- },
537
- whitelist: {
538
- permission: 3,
539
- },
540
- },
541
- };
542
- //# sourceMappingURL=1.15.js.map
@@ -1,10 +0,0 @@
1
- import type { PartialRootTreeNode } from '@spyglassmc/mcfunction';
2
- /**
3
- * Patch for Minecraft: Java Edition 1.16.5
4
- *
5
- * The following parsers are patched with new properties:
6
- * - `minecraft:resource_location`
7
- * - `minecraft:uuid`
8
- */
9
- export declare const Tree1_16: PartialRootTreeNode;
10
- //# sourceMappingURL=1.16.d.ts.map
@@ -1,77 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Tree1_16 = void 0;
4
- const core_1 = require("@spyglassmc/core");
5
- const _1_15_1 = require("./1.15");
6
- /**
7
- * Patch for Minecraft: Java Edition 1.16.5
8
- *
9
- * The following parsers are patched with new properties:
10
- * - `minecraft:resource_location`
11
- * - `minecraft:uuid`
12
- */
13
- exports.Tree1_16 = (0, core_1.merge)(_1_15_1.Tree1_15, {
14
- children: {
15
- attribute: {
16
- children: {
17
- target: {
18
- children: {
19
- attribute: {
20
- properties: {
21
- category: 'attribute',
22
- },
23
- children: {
24
- modifier: {
25
- children: {
26
- add: {
27
- children: {
28
- uuid: {
29
- properties: {
30
- category: 'attribute_modifier_uuid',
31
- usageType: 'definition',
32
- },
33
- },
34
- },
35
- },
36
- remove: {
37
- children: {
38
- uuid: {
39
- properties: {
40
- category: 'attribute_modifier_uuid',
41
- },
42
- },
43
- },
44
- },
45
- value: {
46
- children: {
47
- get: {
48
- children: {
49
- uuid: {
50
- properties: {
51
- category: 'attribute_modifier_uuid',
52
- },
53
- },
54
- },
55
- },
56
- },
57
- },
58
- },
59
- },
60
- },
61
- },
62
- },
63
- },
64
- },
65
- },
66
- locatebiome: {
67
- children: {
68
- biome: {
69
- properties: {
70
- category: 'worldgen/biome',
71
- },
72
- },
73
- },
74
- },
75
- },
76
- });
77
- //# sourceMappingURL=1.16.js.map
@@ -1,12 +0,0 @@
1
- import type { PartialRootTreeNode } from '@spyglassmc/mcfunction';
2
- /**
3
- * Patch for Minecraft: Java Edition 1.17.1
4
- *
5
- * The following parsers are patched with new properties:
6
- * - `minecraft:resource_location`
7
- *
8
- * The following commands are removed:
9
- * - `replaceitem`
10
- */
11
- export declare const Tree1_17: PartialRootTreeNode;
12
- //# sourceMappingURL=1.17.d.ts.map