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