@spyglassmc/java-edition 0.1.3 → 0.2.0
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/lib/binder/index.d.ts +1 -1
- package/lib/binder/index.js +11 -17
- package/lib/common/index.js +4 -32
- package/lib/dependency/common.js +6 -9
- package/lib/dependency/index.d.ts +6 -6
- package/lib/dependency/index.js +18 -49
- package/lib/dependency/mcmeta.d.ts +2 -2
- package/lib/dependency/mcmeta.js +8 -37
- package/lib/index.d.ts +3 -3
- package/lib/index.js +21 -48
- package/lib/json/checker/data/advancement.d.ts +13 -13
- package/lib/json/checker/data/advancement.js +259 -262
- package/lib/json/checker/data/biome.d.ts +3 -3
- package/lib/json/checker/data/biome.js +98 -101
- package/lib/json/checker/data/common.d.ts +1 -1
- package/lib/json/checker/data/common.js +145 -152
- package/lib/json/checker/data/dimension.d.ts +3 -3
- package/lib/json/checker/data/dimension.js +148 -151
- package/lib/json/checker/data/feature.d.ts +8 -8
- package/lib/json/checker/data/feature.js +369 -372
- package/lib/json/checker/data/index.d.ts +2 -2
- package/lib/json/checker/data/index.js +36 -39
- package/lib/json/checker/data/loot_table.d.ts +7 -7
- package/lib/json/checker/data/loot_table.js +125 -128
- package/lib/json/checker/data/recipe.d.ts +1 -1
- package/lib/json/checker/data/recipe.js +25 -28
- package/lib/json/checker/data/structure.d.ts +7 -7
- package/lib/json/checker/data/structure.js +80 -83
- package/lib/json/checker/data/tag.js +23 -26
- package/lib/json/checker/data/text_component.d.ts +1 -1
- package/lib/json/checker/data/text_component.js +61 -64
- package/lib/json/checker/index.js +14 -19
- package/lib/json/checker/util/advancement.d.ts +1 -1
- package/lib/json/checker/util/advancement.js +4 -8
- package/lib/json/checker/util/block_states.d.ts +1 -1
- package/lib/json/checker/util/block_states.js +21 -49
- package/lib/json/checker/util/color.d.ts +1 -1
- package/lib/json/checker/util/color.js +20 -25
- package/lib/json/checker/util/index.d.ts +7 -7
- package/lib/json/checker/util/index.js +7 -23
- package/lib/json/checker/util/nbt.d.ts +1 -1
- package/lib/json/checker/util/nbt.js +17 -22
- package/lib/json/checker/util/recipe.d.ts +1 -1
- package/lib/json/checker/util/recipe.js +4 -8
- package/lib/json/checker/util/uuid.d.ts +1 -1
- package/lib/json/checker/util/uuid.js +4 -7
- package/lib/json/checker/util/version.d.ts +2 -2
- package/lib/json/checker/util/version.js +7 -13
- package/lib/json/index.d.ts +1 -1
- package/lib/json/index.js +4 -31
- package/lib/mcfunction/checker/index.d.ts +1 -1
- package/lib/mcfunction/checker/index.js +24 -53
- package/lib/mcfunction/colorizer/index.d.ts +1 -1
- package/lib/mcfunction/colorizer/index.js +6 -35
- package/lib/mcfunction/common/index.js +7 -33
- package/lib/mcfunction/completer/argument.js +92 -120
- package/lib/mcfunction/completer/index.d.ts +1 -1
- package/lib/mcfunction/completer/index.js +1 -17
- package/lib/mcfunction/index.d.ts +5 -5
- package/lib/mcfunction/index.js +16 -43
- package/lib/mcfunction/inlayHintProvider.js +3 -30
- package/lib/mcfunction/node/argument.d.ts +3 -3
- package/lib/mcfunction/node/argument.js +37 -63
- package/lib/mcfunction/node/index.d.ts +1 -1
- package/lib/mcfunction/node/index.js +1 -17
- package/lib/mcfunction/parser/argument.d.ts +1 -1
- package/lib/mcfunction/parser/argument.js +71 -100
- package/lib/mcfunction/parser/index.d.ts +1 -1
- package/lib/mcfunction/parser/index.js +1 -17
- package/lib/mcfunction/signatureHelpProvider.js +3 -30
- package/lib/mcfunction/tree/argument.js +1 -2
- package/lib/mcfunction/tree/index.d.ts +1 -1
- package/lib/mcfunction/tree/index.js +1 -17
- package/lib/mcfunction/tree/patch.d.ts +1 -1
- package/lib/mcfunction/tree/patch.js +5 -9
- package/package.json +8 -7
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const common_1 = require("./common");
|
|
8
|
-
const loot_table_1 = require("./loot_table");
|
|
9
|
-
const text_component_1 = require("./text_component");
|
|
1
|
+
import { any, as, boolean, dispatch, extract, extractStringArray, int, listOf, literal, object, opt, pick, record, ref, resource, simpleString, string, when } from '@spyglassmc/json/lib/checker/primitives/index.js';
|
|
2
|
+
import { dissectUri } from '../../../binder/index.js';
|
|
3
|
+
import { blockStateMap, criterionReference, deprecated, nbt, versioned } from '../util/index.js';
|
|
4
|
+
import { float_bounds, int_bounds, Slots } from './common.js';
|
|
5
|
+
import { predicate } from './loot_table.js';
|
|
6
|
+
import { text_component } from './text_component.js';
|
|
10
7
|
const Triggers = (ctx) => [
|
|
11
8
|
'minecraft:bee_nest_destroyed',
|
|
12
9
|
'minecraft:bred_animals',
|
|
@@ -21,408 +18,408 @@ const Triggers = (ctx) => [
|
|
|
21
18
|
'minecraft:enter_block',
|
|
22
19
|
'minecraft:entity_hurt_player',
|
|
23
20
|
'minecraft:entity_killed_player',
|
|
24
|
-
...
|
|
21
|
+
...versioned(ctx, '1.18', ['minecraft:fall_from_height']),
|
|
25
22
|
'minecraft:filled_bucket',
|
|
26
23
|
'minecraft:fishing_rod_hooked',
|
|
27
24
|
'minecraft:hero_of_the_village',
|
|
28
25
|
'minecraft:impossible',
|
|
29
26
|
'minecraft:inventory_changed',
|
|
30
27
|
'minecraft:item_durability_changed',
|
|
31
|
-
...
|
|
28
|
+
...versioned(ctx, '1.16', ['minecraft:item_used_on_block']),
|
|
32
29
|
'minecraft:killed_by_crossbow',
|
|
33
30
|
'minecraft:levitation',
|
|
34
|
-
...
|
|
31
|
+
...versioned(ctx, '1.17', ['minecraft:lightning_strike']),
|
|
35
32
|
'minecraft:location',
|
|
36
33
|
'minecraft:nether_travel',
|
|
37
34
|
'minecraft:placed_block',
|
|
38
|
-
...
|
|
35
|
+
...versioned(ctx, '1.16', ['minecraft:player_generates_container_loot']),
|
|
39
36
|
'minecraft:player_hurt_entity',
|
|
40
|
-
...
|
|
37
|
+
...versioned(ctx, '1.16', ['minecraft:player_interacted_with_entity']),
|
|
41
38
|
'minecraft:player_killed_entity',
|
|
42
39
|
'minecraft:recipe_unlocked',
|
|
43
|
-
...
|
|
40
|
+
...versioned(ctx, '1.18', ['minecraft:ride_entity_in_lava']),
|
|
44
41
|
'minecraft:shot_crossbow',
|
|
45
|
-
...
|
|
42
|
+
...versioned(ctx, ['minecraft:safely_harvest_honey'], '1.16'),
|
|
46
43
|
'minecraft:slept_in_bed',
|
|
47
44
|
'minecraft:slide_down_block',
|
|
48
|
-
...
|
|
45
|
+
...versioned(ctx, '1.17', ['minecraft:started_riding']),
|
|
49
46
|
'minecraft:summoned_entity',
|
|
50
47
|
'minecraft:tame_animal',
|
|
51
|
-
...
|
|
48
|
+
...versioned(ctx, '1.16', ['minecraft:target_hit']),
|
|
52
49
|
'minecraft:tick',
|
|
53
|
-
...
|
|
50
|
+
...versioned(ctx, '1.16', ['minecraft:thrown_item_picked_up_by_entity']),
|
|
54
51
|
'minecraft:used_ender_eye',
|
|
55
52
|
'minecraft:used_totem',
|
|
56
|
-
...
|
|
53
|
+
...versioned(ctx, '1.17', ['minecraft:using_item']),
|
|
57
54
|
'minecraft:villager_trade',
|
|
58
55
|
'minecraft:voluntary_exile',
|
|
59
56
|
];
|
|
60
|
-
|
|
61
|
-
...
|
|
62
|
-
item:
|
|
57
|
+
export const item_predicate = as('item', dispatch((props, ctx) => record({
|
|
58
|
+
...versioned(ctx, {
|
|
59
|
+
item: opt(resource('item')),
|
|
63
60
|
}, '1.17', {
|
|
64
|
-
items:
|
|
61
|
+
items: opt(listOf(resource('item'))),
|
|
65
62
|
}),
|
|
66
|
-
tag:
|
|
67
|
-
count:
|
|
68
|
-
durability:
|
|
69
|
-
potion:
|
|
70
|
-
nbt:
|
|
71
|
-
enchantments:
|
|
72
|
-
enchantment:
|
|
73
|
-
levels:
|
|
63
|
+
tag: opt(resource('tag/item')),
|
|
64
|
+
count: opt(int_bounds),
|
|
65
|
+
durability: opt(float_bounds),
|
|
66
|
+
potion: opt(resource('potion')),
|
|
67
|
+
nbt: opt(nbt({ registry: 'item', ids: extractStringArray('items', props), tag: extract('tag', props) })),
|
|
68
|
+
enchantments: opt(listOf(record({
|
|
69
|
+
enchantment: opt(resource('enchantment')),
|
|
70
|
+
levels: opt(int_bounds),
|
|
74
71
|
}))),
|
|
75
72
|
})));
|
|
76
|
-
|
|
77
|
-
...
|
|
78
|
-
block:
|
|
73
|
+
export const block_predicate = as('block', dispatch((props, ctx) => record({
|
|
74
|
+
...versioned(ctx, {
|
|
75
|
+
block: opt(resource('block')),
|
|
79
76
|
}, '1.17', {
|
|
80
|
-
blocks:
|
|
77
|
+
blocks: opt(listOf(resource('block'))),
|
|
81
78
|
}),
|
|
82
|
-
tag:
|
|
83
|
-
nbt:
|
|
84
|
-
state:
|
|
85
|
-
ids:
|
|
86
|
-
tag:
|
|
79
|
+
tag: opt(resource('tag/block')),
|
|
80
|
+
nbt: opt(nbt({ registry: 'block', ids: extractStringArray('blocks', props), tag: extract('tag', props) })),
|
|
81
|
+
state: opt(blockStateMap({
|
|
82
|
+
ids: extractStringArray('blocks', props),
|
|
83
|
+
tag: extract('tag', props),
|
|
87
84
|
mixedTypes: true,
|
|
88
85
|
})),
|
|
89
86
|
})));
|
|
90
|
-
|
|
91
|
-
fluid:
|
|
92
|
-
tag:
|
|
93
|
-
state:
|
|
87
|
+
export const fluid_predicate = as('fluid', dispatch(props => record({
|
|
88
|
+
fluid: opt(resource('fluid')),
|
|
89
|
+
tag: opt(resource('tag/fluid')),
|
|
90
|
+
state: opt(blockStateMap({
|
|
94
91
|
category: 'fluid',
|
|
95
|
-
id:
|
|
96
|
-
tag:
|
|
92
|
+
id: extract('fluid', props),
|
|
93
|
+
tag: extract('tag', props),
|
|
97
94
|
mixedTypes: true,
|
|
98
95
|
})),
|
|
99
96
|
})));
|
|
100
|
-
|
|
101
|
-
position:
|
|
102
|
-
x:
|
|
103
|
-
y:
|
|
104
|
-
z:
|
|
97
|
+
export const location_predicate = as('location', dispatch((_, ctx) => record({
|
|
98
|
+
position: opt(record({
|
|
99
|
+
x: opt(float_bounds),
|
|
100
|
+
y: opt(float_bounds),
|
|
101
|
+
z: opt(float_bounds),
|
|
105
102
|
})),
|
|
106
|
-
biome:
|
|
107
|
-
feature:
|
|
108
|
-
dimension:
|
|
109
|
-
block:
|
|
110
|
-
fluid:
|
|
111
|
-
light:
|
|
112
|
-
light:
|
|
103
|
+
biome: opt(resource('worldgen/biome')),
|
|
104
|
+
feature: opt(simpleString),
|
|
105
|
+
dimension: opt(resource('dimension')),
|
|
106
|
+
block: opt(block_predicate),
|
|
107
|
+
fluid: opt(fluid_predicate),
|
|
108
|
+
light: opt(record({
|
|
109
|
+
light: int_bounds,
|
|
113
110
|
})),
|
|
114
|
-
smokey:
|
|
111
|
+
smokey: opt(versioned(ctx, '1.16', boolean)),
|
|
115
112
|
})));
|
|
116
|
-
|
|
117
|
-
x:
|
|
118
|
-
y:
|
|
119
|
-
z:
|
|
120
|
-
absolute:
|
|
121
|
-
horizontal:
|
|
113
|
+
export const distance_predicate = as('distance', record({
|
|
114
|
+
x: opt(float_bounds),
|
|
115
|
+
y: opt(float_bounds),
|
|
116
|
+
z: opt(float_bounds),
|
|
117
|
+
absolute: opt(float_bounds),
|
|
118
|
+
horizontal: opt(float_bounds),
|
|
122
119
|
}));
|
|
123
|
-
|
|
124
|
-
amplifier:
|
|
125
|
-
duration:
|
|
126
|
-
ambient:
|
|
127
|
-
visible:
|
|
120
|
+
export const mob_effect_predicate = as('mob_effect', record({
|
|
121
|
+
amplifier: opt(int_bounds),
|
|
122
|
+
duration: opt(int_bounds),
|
|
123
|
+
ambient: opt(boolean),
|
|
124
|
+
visible: opt(boolean),
|
|
128
125
|
}));
|
|
129
|
-
|
|
130
|
-
type:
|
|
131
|
-
...
|
|
132
|
-
mined: { stat:
|
|
133
|
-
crafted: { stat:
|
|
134
|
-
used: { stat:
|
|
135
|
-
broken: { stat:
|
|
136
|
-
picked_up: { stat:
|
|
137
|
-
dropped: { stat:
|
|
138
|
-
killed: { stat:
|
|
139
|
-
killed_by: { stat:
|
|
140
|
-
custom: { stat:
|
|
126
|
+
export const statistic_predicate = as('statistic', dispatch('type', (stat) => record({
|
|
127
|
+
type: resource('stat_type'),
|
|
128
|
+
...pick(stat, {
|
|
129
|
+
mined: { stat: resource('block') },
|
|
130
|
+
crafted: { stat: resource('item') },
|
|
131
|
+
used: { stat: resource('item') },
|
|
132
|
+
broken: { stat: resource('item') },
|
|
133
|
+
picked_up: { stat: resource('item') },
|
|
134
|
+
dropped: { stat: resource('item') },
|
|
135
|
+
killed: { stat: resource('entity_type') },
|
|
136
|
+
killed_by: { stat: resource('entity_type') },
|
|
137
|
+
custom: { stat: resource('custom_stat') },
|
|
141
138
|
}),
|
|
142
|
-
value:
|
|
139
|
+
value: int_bounds,
|
|
143
140
|
})));
|
|
144
|
-
|
|
145
|
-
gamemode:
|
|
146
|
-
level:
|
|
147
|
-
advancements:
|
|
148
|
-
|
|
149
|
-
|
|
141
|
+
export const player_predicate = as('player', dispatch((_, ctx) => record({
|
|
142
|
+
gamemode: opt(literal(['survival', 'adventure', 'creative', 'spectator'])),
|
|
143
|
+
level: opt(int_bounds),
|
|
144
|
+
advancements: opt(object(resource('advancement'), (advancement) => any([
|
|
145
|
+
boolean,
|
|
146
|
+
object(criterionReference(advancement), () => boolean),
|
|
150
147
|
]))),
|
|
151
|
-
recipes:
|
|
152
|
-
stats:
|
|
153
|
-
looking_at:
|
|
148
|
+
recipes: opt(object(resource('recipe'), () => boolean)),
|
|
149
|
+
stats: opt(listOf(statistic_predicate)),
|
|
150
|
+
looking_at: opt(versioned(ctx, '1.17', ref(() => entity_predicate))),
|
|
154
151
|
})));
|
|
155
|
-
|
|
156
|
-
type:
|
|
157
|
-
nbt:
|
|
158
|
-
team:
|
|
159
|
-
location:
|
|
160
|
-
stepping_on:
|
|
161
|
-
distance:
|
|
162
|
-
flags:
|
|
163
|
-
is_on_fire:
|
|
164
|
-
is_sneaking:
|
|
165
|
-
is_sprinting:
|
|
166
|
-
is_swimming:
|
|
167
|
-
is_baby:
|
|
152
|
+
export const entity_predicate = as('entity', dispatch((props, ctx) => record({
|
|
153
|
+
type: opt(resource('entity_type', true)),
|
|
154
|
+
nbt: opt(nbt({ registry: 'entity_type', idOrTag: extract('type', props) })),
|
|
155
|
+
team: opt(literal('team')),
|
|
156
|
+
location: opt(location_predicate),
|
|
157
|
+
stepping_on: opt(versioned(ctx, '1.17', location_predicate)),
|
|
158
|
+
distance: opt(distance_predicate),
|
|
159
|
+
flags: opt(record({
|
|
160
|
+
is_on_fire: opt(boolean),
|
|
161
|
+
is_sneaking: opt(boolean),
|
|
162
|
+
is_sprinting: opt(boolean),
|
|
163
|
+
is_swimming: opt(boolean),
|
|
164
|
+
is_baby: opt(boolean),
|
|
168
165
|
})),
|
|
169
|
-
equipment:
|
|
170
|
-
effects:
|
|
171
|
-
player:
|
|
172
|
-
vehicle:
|
|
173
|
-
passenger:
|
|
174
|
-
targeted_entity:
|
|
175
|
-
lightning_bolt:
|
|
176
|
-
blocks_set_on_fire:
|
|
177
|
-
entity_struck:
|
|
166
|
+
equipment: opt(object(literal(Slots), () => item_predicate)),
|
|
167
|
+
effects: opt(object(simpleString, () => mob_effect_predicate)),
|
|
168
|
+
player: opt(player_predicate),
|
|
169
|
+
vehicle: opt(versioned(ctx, '1.16', ref(() => entity_predicate))),
|
|
170
|
+
passenger: opt(versioned(ctx, '1.17', ref(() => entity_predicate))),
|
|
171
|
+
targeted_entity: opt(versioned(ctx, '1.16', ref(() => entity_predicate))),
|
|
172
|
+
lightning_bolt: opt(versioned(ctx, '1.17', record({
|
|
173
|
+
blocks_set_on_fire: opt(int_bounds),
|
|
174
|
+
entity_struck: opt(ref(() => entity_predicate)),
|
|
178
175
|
}))),
|
|
179
|
-
fishing_hook:
|
|
180
|
-
in_open_water:
|
|
176
|
+
fishing_hook: opt(versioned(ctx, '1.16', record({
|
|
177
|
+
in_open_water: opt(boolean),
|
|
181
178
|
}))),
|
|
182
|
-
catType:
|
|
179
|
+
catType: opt(simpleString),
|
|
183
180
|
})));
|
|
184
|
-
|
|
185
|
-
is_explosion:
|
|
186
|
-
is_fire:
|
|
187
|
-
is_magic:
|
|
188
|
-
is_projectile:
|
|
189
|
-
is_lightning:
|
|
190
|
-
bypasses_armor:
|
|
191
|
-
bypasses_invulnerability:
|
|
192
|
-
bypasses_magic:
|
|
193
|
-
source_entity:
|
|
194
|
-
direct_entity:
|
|
181
|
+
export const damage_source_predicate = as('damage_source', record({
|
|
182
|
+
is_explosion: opt(boolean),
|
|
183
|
+
is_fire: opt(boolean),
|
|
184
|
+
is_magic: opt(boolean),
|
|
185
|
+
is_projectile: opt(boolean),
|
|
186
|
+
is_lightning: opt(boolean),
|
|
187
|
+
bypasses_armor: opt(boolean),
|
|
188
|
+
bypasses_invulnerability: opt(boolean),
|
|
189
|
+
bypasses_magic: opt(boolean),
|
|
190
|
+
source_entity: opt(entity_predicate),
|
|
191
|
+
direct_entity: opt(entity_predicate),
|
|
195
192
|
}));
|
|
196
|
-
|
|
197
|
-
dealt:
|
|
198
|
-
taken:
|
|
199
|
-
blocked:
|
|
200
|
-
source_entity:
|
|
201
|
-
type:
|
|
193
|
+
export const damage_predicate = as('damage', record({
|
|
194
|
+
dealt: opt(int_bounds),
|
|
195
|
+
taken: opt(int_bounds),
|
|
196
|
+
blocked: opt(boolean),
|
|
197
|
+
source_entity: opt(entity_predicate),
|
|
198
|
+
type: opt(damage_source_predicate),
|
|
202
199
|
}));
|
|
203
|
-
const entity =
|
|
204
|
-
|
|
205
|
-
|
|
200
|
+
const entity = any([
|
|
201
|
+
entity_predicate,
|
|
202
|
+
listOf(ref(() => predicate)),
|
|
206
203
|
]);
|
|
207
|
-
|
|
208
|
-
trigger:
|
|
209
|
-
conditions:
|
|
210
|
-
...
|
|
211
|
-
player:
|
|
204
|
+
export const criterion = as('criterion', dispatch('trigger', (trigger, _, ctx) => record({
|
|
205
|
+
trigger: resource(Triggers(ctx)),
|
|
206
|
+
conditions: opt(dispatch(props => record({
|
|
207
|
+
...versioned(ctx, '1.16', when(trigger, ['impossible'], {}, {
|
|
208
|
+
player: opt(versioned(ctx, entity_predicate, '1.16', entity)),
|
|
212
209
|
})),
|
|
213
|
-
...
|
|
210
|
+
...pick(trigger, {
|
|
214
211
|
bee_nest_destroyed: {
|
|
215
|
-
block:
|
|
216
|
-
item:
|
|
217
|
-
num_bees_inside:
|
|
212
|
+
block: opt(resource('block')),
|
|
213
|
+
item: opt(item_predicate),
|
|
214
|
+
num_bees_inside: opt(int),
|
|
218
215
|
},
|
|
219
216
|
bred_animals: {
|
|
220
|
-
parent:
|
|
221
|
-
partner:
|
|
222
|
-
child:
|
|
217
|
+
parent: opt(versioned(ctx, entity_predicate, '1.16', entity)),
|
|
218
|
+
partner: opt(versioned(ctx, entity_predicate, '1.16', entity)),
|
|
219
|
+
child: opt(versioned(ctx, entity_predicate, '1.16', entity)),
|
|
223
220
|
},
|
|
224
221
|
brewed_potion: {
|
|
225
|
-
potion:
|
|
222
|
+
potion: opt(resource('potion')),
|
|
226
223
|
},
|
|
227
224
|
changed_dimension: {
|
|
228
|
-
from:
|
|
229
|
-
to:
|
|
225
|
+
from: opt(resource('dimension')),
|
|
226
|
+
to: opt(resource('dimension')),
|
|
230
227
|
},
|
|
231
228
|
channeled_lightning: {
|
|
232
|
-
victims:
|
|
229
|
+
victims: opt(listOf(versioned(ctx, entity_predicate, '1.16', entity))),
|
|
233
230
|
},
|
|
234
231
|
construct_beacon: {
|
|
235
|
-
level:
|
|
232
|
+
level: opt(int_bounds),
|
|
236
233
|
},
|
|
237
234
|
consume_item: {
|
|
238
|
-
item:
|
|
235
|
+
item: opt(item_predicate),
|
|
239
236
|
},
|
|
240
237
|
cured_zombie_villager: {
|
|
241
|
-
villager:
|
|
242
|
-
zombie:
|
|
238
|
+
villager: opt(versioned(ctx, entity_predicate, '1.16', entity)),
|
|
239
|
+
zombie: opt(versioned(ctx, entity_predicate, '1.16', entity)),
|
|
243
240
|
},
|
|
244
241
|
effects_changed: {
|
|
245
|
-
effects:
|
|
246
|
-
source:
|
|
242
|
+
effects: opt(object(resource('mob_effect'), () => mob_effect_predicate)),
|
|
243
|
+
source: opt(versioned(ctx, entity_predicate, '1.16', entity)),
|
|
247
244
|
},
|
|
248
245
|
enter_block: {
|
|
249
|
-
block:
|
|
250
|
-
state:
|
|
246
|
+
block: opt(resource('block')),
|
|
247
|
+
state: opt(blockStateMap({ id: extract('block', props) })),
|
|
251
248
|
},
|
|
252
249
|
enchanted_item: {
|
|
253
|
-
levels:
|
|
254
|
-
item:
|
|
250
|
+
levels: opt(int_bounds),
|
|
251
|
+
item: opt(item_predicate),
|
|
255
252
|
},
|
|
256
253
|
entity_hurt_player: {
|
|
257
|
-
damage:
|
|
254
|
+
damage: opt(damage_predicate),
|
|
258
255
|
},
|
|
259
256
|
entity_killed_player: {
|
|
260
|
-
entity:
|
|
261
|
-
killing_blow:
|
|
257
|
+
entity: opt(versioned(ctx, entity_predicate, '1.16', entity)),
|
|
258
|
+
killing_blow: opt(damage_source_predicate),
|
|
262
259
|
},
|
|
263
260
|
fall_from_height: {
|
|
264
|
-
start_position:
|
|
265
|
-
distance:
|
|
261
|
+
start_position: opt(location_predicate),
|
|
262
|
+
distance: opt(distance_predicate),
|
|
266
263
|
},
|
|
267
264
|
filled_bucket: {
|
|
268
|
-
item:
|
|
265
|
+
item: opt(item_predicate),
|
|
269
266
|
},
|
|
270
267
|
fishing_rod_hooked: {
|
|
271
|
-
entity:
|
|
272
|
-
item:
|
|
268
|
+
entity: opt(versioned(ctx, entity_predicate, '1.16', entity)),
|
|
269
|
+
item: opt(item_predicate),
|
|
273
270
|
},
|
|
274
271
|
hero_of_the_village: {
|
|
275
|
-
location:
|
|
272
|
+
location: opt(versioned(ctx, '1.16', location_predicate)),
|
|
276
273
|
},
|
|
277
274
|
inventory_changed: {
|
|
278
|
-
slots:
|
|
279
|
-
empty:
|
|
280
|
-
occupied:
|
|
281
|
-
full:
|
|
275
|
+
slots: opt(record({
|
|
276
|
+
empty: opt(int_bounds),
|
|
277
|
+
occupied: opt(int_bounds),
|
|
278
|
+
full: opt(int_bounds),
|
|
282
279
|
})),
|
|
283
|
-
items:
|
|
280
|
+
items: opt(listOf(item_predicate)),
|
|
284
281
|
},
|
|
285
282
|
item_durability_changed: {
|
|
286
|
-
delta:
|
|
287
|
-
durability:
|
|
288
|
-
item:
|
|
283
|
+
delta: opt(float_bounds),
|
|
284
|
+
durability: opt(float_bounds),
|
|
285
|
+
item: opt(item_predicate),
|
|
289
286
|
},
|
|
290
287
|
item_used_on_block: {
|
|
291
|
-
item:
|
|
292
|
-
location:
|
|
288
|
+
item: opt(item_predicate),
|
|
289
|
+
location: opt(location_predicate),
|
|
293
290
|
},
|
|
294
291
|
killed_by_crossbow: {
|
|
295
|
-
unique_entity_types:
|
|
296
|
-
victims:
|
|
292
|
+
unique_entity_types: opt(int_bounds),
|
|
293
|
+
victims: opt(listOf(versioned(ctx, entity_predicate, '1.16', entity))),
|
|
297
294
|
},
|
|
298
295
|
levitation: {
|
|
299
|
-
distance:
|
|
300
|
-
duration:
|
|
296
|
+
distance: opt(distance_predicate),
|
|
297
|
+
duration: opt(float_bounds),
|
|
301
298
|
},
|
|
302
299
|
lightning_strike: {
|
|
303
|
-
lightning:
|
|
304
|
-
bystander:
|
|
300
|
+
lightning: opt(versioned(ctx, entity_predicate, '1.16', entity)),
|
|
301
|
+
bystander: opt(versioned(ctx, entity_predicate, '1.16', entity)),
|
|
305
302
|
},
|
|
306
303
|
location: {
|
|
307
|
-
location:
|
|
304
|
+
location: opt(versioned(ctx, '1.16', location_predicate)),
|
|
308
305
|
},
|
|
309
306
|
nether_travel: {
|
|
310
|
-
...
|
|
311
|
-
entered:
|
|
307
|
+
...versioned(ctx, {
|
|
308
|
+
entered: opt(location_predicate),
|
|
312
309
|
}, '1.18', {
|
|
313
|
-
start_position:
|
|
310
|
+
start_position: opt(location_predicate),
|
|
314
311
|
}),
|
|
315
|
-
exited:
|
|
316
|
-
distance:
|
|
312
|
+
exited: opt(versioned(ctx, location_predicate, '1.18')),
|
|
313
|
+
distance: opt(distance_predicate),
|
|
317
314
|
},
|
|
318
315
|
placed_block: {
|
|
319
|
-
block:
|
|
320
|
-
state:
|
|
321
|
-
item:
|
|
322
|
-
location:
|
|
316
|
+
block: opt(resource('block')),
|
|
317
|
+
state: opt(blockStateMap({ id: extract('block', props) })),
|
|
318
|
+
item: opt(item_predicate),
|
|
319
|
+
location: opt(location_predicate),
|
|
323
320
|
},
|
|
324
321
|
player_generates_container_loot: {
|
|
325
|
-
loot_table:
|
|
322
|
+
loot_table: resource('loot_table'),
|
|
326
323
|
},
|
|
327
324
|
player_hurt_entity: {
|
|
328
|
-
damage:
|
|
329
|
-
entity:
|
|
325
|
+
damage: opt(damage_predicate),
|
|
326
|
+
entity: opt(versioned(ctx, entity_predicate, '1.16', entity)),
|
|
330
327
|
},
|
|
331
328
|
player_interacted_with_entity: {
|
|
332
|
-
item:
|
|
333
|
-
entity:
|
|
329
|
+
item: opt(item_predicate),
|
|
330
|
+
entity: opt(versioned(ctx, entity_predicate, '1.16', entity)),
|
|
334
331
|
},
|
|
335
332
|
player_killed_entity: {
|
|
336
|
-
entity:
|
|
337
|
-
killing_blow:
|
|
333
|
+
entity: opt(versioned(ctx, entity_predicate, '1.16', entity)),
|
|
334
|
+
killing_blow: opt(damage_source_predicate),
|
|
338
335
|
},
|
|
339
336
|
recipe_unlocked: {
|
|
340
|
-
recipe:
|
|
337
|
+
recipe: resource('recipe'),
|
|
341
338
|
},
|
|
342
339
|
ride_entity_in_lava: {
|
|
343
|
-
start_position:
|
|
344
|
-
distance:
|
|
340
|
+
start_position: opt(location_predicate),
|
|
341
|
+
distance: opt(distance_predicate),
|
|
345
342
|
},
|
|
346
343
|
slept_in_bed: {
|
|
347
|
-
location:
|
|
344
|
+
location: opt(versioned(ctx, '1.16', location_predicate)),
|
|
348
345
|
},
|
|
349
346
|
slide_down_block: {
|
|
350
|
-
block:
|
|
347
|
+
block: opt(resource('block')),
|
|
351
348
|
},
|
|
352
349
|
shot_crossbow: {
|
|
353
|
-
item:
|
|
350
|
+
item: opt(item_predicate),
|
|
354
351
|
},
|
|
355
352
|
summoned_entity: {
|
|
356
|
-
entity:
|
|
353
|
+
entity: opt(versioned(ctx, entity_predicate, '1.16', entity)),
|
|
357
354
|
},
|
|
358
355
|
tame_animal: {
|
|
359
|
-
entity:
|
|
356
|
+
entity: opt(versioned(ctx, entity_predicate, '1.16', entity)),
|
|
360
357
|
},
|
|
361
358
|
target_hit: {
|
|
362
|
-
projectile:
|
|
363
|
-
shooter:
|
|
364
|
-
signal_strength:
|
|
359
|
+
projectile: opt(versioned(ctx, entity_predicate, '1.16', entity)),
|
|
360
|
+
shooter: opt(versioned(ctx, entity_predicate, '1.16', entity)),
|
|
361
|
+
signal_strength: opt(int_bounds),
|
|
365
362
|
},
|
|
366
363
|
thrown_item_picked_up_by_entity: {
|
|
367
|
-
entity:
|
|
368
|
-
item:
|
|
364
|
+
entity: opt(versioned(ctx, entity_predicate, '1.16', entity)),
|
|
365
|
+
item: opt(item_predicate),
|
|
369
366
|
},
|
|
370
367
|
used_ender_eye: {
|
|
371
|
-
distance:
|
|
368
|
+
distance: opt(float_bounds),
|
|
372
369
|
},
|
|
373
370
|
used_totem: {
|
|
374
|
-
item:
|
|
371
|
+
item: opt(item_predicate),
|
|
375
372
|
},
|
|
376
373
|
using_item: {
|
|
377
|
-
item:
|
|
374
|
+
item: opt(item_predicate),
|
|
378
375
|
},
|
|
379
376
|
villager_trade: {
|
|
380
|
-
villager:
|
|
381
|
-
item:
|
|
377
|
+
villager: opt(entity_predicate),
|
|
378
|
+
item: opt(item_predicate),
|
|
382
379
|
},
|
|
383
380
|
voluntary_exile: {
|
|
384
|
-
location:
|
|
381
|
+
location: opt(versioned(ctx, '1.16', location_predicate)),
|
|
385
382
|
},
|
|
386
383
|
}),
|
|
387
|
-
...
|
|
388
|
-
position:
|
|
389
|
-
x:
|
|
390
|
-
y:
|
|
391
|
-
z:
|
|
384
|
+
...when(trigger, ['hero_of_the_village', 'location', 'slept_in_bed', 'voluntary_exile'], {
|
|
385
|
+
position: opt(deprecated(ctx, '1.16', record({
|
|
386
|
+
x: opt(float_bounds),
|
|
387
|
+
y: opt(float_bounds),
|
|
388
|
+
z: opt(float_bounds),
|
|
392
389
|
}))),
|
|
393
|
-
biome:
|
|
394
|
-
feature:
|
|
395
|
-
dimension:
|
|
396
|
-
block:
|
|
397
|
-
fluid:
|
|
398
|
-
light:
|
|
399
|
-
light:
|
|
390
|
+
biome: opt(deprecated(ctx, '1.16', resource('worldgen/biome'))),
|
|
391
|
+
feature: opt(deprecated(ctx, '1.16', simpleString)),
|
|
392
|
+
dimension: opt(deprecated(ctx, '1.16', resource('dimension'))),
|
|
393
|
+
block: opt(deprecated(ctx, '1.16', block_predicate)),
|
|
394
|
+
fluid: opt(deprecated(ctx, '1.16', fluid_predicate)),
|
|
395
|
+
light: opt(deprecated(ctx, '1.16', record({
|
|
396
|
+
light: int_bounds,
|
|
400
397
|
}))),
|
|
401
|
-
smokey:
|
|
398
|
+
smokey: opt(deprecated(ctx, '1.16', boolean)),
|
|
402
399
|
}),
|
|
403
400
|
}))),
|
|
404
401
|
})));
|
|
405
|
-
|
|
406
|
-
display:
|
|
407
|
-
icon:
|
|
408
|
-
item:
|
|
409
|
-
nbt:
|
|
402
|
+
export const advancement = as('advancement', record({
|
|
403
|
+
display: opt(record({
|
|
404
|
+
icon: dispatch(props => record({
|
|
405
|
+
item: resource('item'),
|
|
406
|
+
nbt: opt(nbt({ registry: 'item', id: extract('item', props) })),
|
|
410
407
|
})),
|
|
411
|
-
title:
|
|
412
|
-
description:
|
|
413
|
-
background:
|
|
414
|
-
frame:
|
|
415
|
-
show_toast:
|
|
416
|
-
announce_to_chat:
|
|
417
|
-
hidden:
|
|
408
|
+
title: text_component,
|
|
409
|
+
description: text_component,
|
|
410
|
+
background: opt(simpleString),
|
|
411
|
+
frame: opt(literal(['task', 'challenge', 'goal']), 'task'),
|
|
412
|
+
show_toast: opt(boolean, true),
|
|
413
|
+
announce_to_chat: opt(boolean, true),
|
|
414
|
+
hidden: opt(boolean, false),
|
|
418
415
|
})),
|
|
419
|
-
parent:
|
|
420
|
-
criteria:
|
|
416
|
+
parent: opt(resource('advancement')),
|
|
417
|
+
criteria: object(string(undefined, undefined, (node, ctx) => {
|
|
421
418
|
// FIXME: Temporary solution to make tests pass when ensureChecked is not given.
|
|
422
419
|
if (!ctx.ensureChecked) {
|
|
423
420
|
return;
|
|
424
421
|
}
|
|
425
|
-
const parts =
|
|
422
|
+
const parts = dissectUri(ctx.doc.uri, ctx);
|
|
426
423
|
const advancement = `${parts?.namespace}:${parts?.identifier}`;
|
|
427
424
|
const criterion = node.value;
|
|
428
425
|
ctx.symbols.query(ctx.doc, 'advancement', advancement, criterion)
|
|
@@ -430,21 +427,21 @@ exports.advancement = (0, primitives_1.as)('advancement', (0, primitives_1.recor
|
|
|
430
427
|
data: { subcategory: 'criterion' },
|
|
431
428
|
usage: { type: 'definition', node },
|
|
432
429
|
});
|
|
433
|
-
}), () =>
|
|
434
|
-
requirements:
|
|
430
|
+
}), () => criterion),
|
|
431
|
+
requirements: opt(listOf(listOf((node, ctx) => {
|
|
435
432
|
// FIXME: Temporary solution to make tests pass when ensureChecked is not given.
|
|
436
433
|
if (!ctx.ensureChecked) {
|
|
437
434
|
return;
|
|
438
435
|
}
|
|
439
|
-
const parts =
|
|
436
|
+
const parts = dissectUri(ctx.doc.uri, ctx);
|
|
440
437
|
const advancement = `${parts?.namespace}:${parts?.identifier}`;
|
|
441
|
-
|
|
438
|
+
criterionReference(advancement)(node, ctx);
|
|
442
439
|
}))),
|
|
443
|
-
rewards:
|
|
444
|
-
function:
|
|
445
|
-
loot:
|
|
446
|
-
recipes:
|
|
447
|
-
experience:
|
|
440
|
+
rewards: opt(record({
|
|
441
|
+
function: opt(resource('function')),
|
|
442
|
+
loot: opt(listOf(resource('loot_table'))),
|
|
443
|
+
recipes: opt(listOf(resource('recipe'))),
|
|
444
|
+
experience: opt(int),
|
|
448
445
|
})),
|
|
449
446
|
}));
|
|
450
447
|
//# sourceMappingURL=advancement.js.map
|