@spyglassmc/java-edition 0.3.3 → 0.3.5

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 (57) hide show
  1. package/lib/binder/index.d.ts +1 -1
  2. package/lib/binder/index.js +1 -1
  3. package/lib/dependency/common.d.ts +0 -4
  4. package/lib/dependency/common.js +0 -15
  5. package/lib/dependency/index.d.ts +8 -0
  6. package/lib/dependency/index.js +23 -1
  7. package/lib/dependency/mcmeta.d.ts +1 -1
  8. package/lib/dependency/mcmeta.js +45 -15
  9. package/lib/index.js +2 -0
  10. package/lib/mcfunction/checker/index.js +1 -2
  11. package/lib/mcfunction/common/index.d.ts +4 -0
  12. package/lib/mcfunction/common/index.js +25 -0
  13. package/lib/mcfunction/completer/argument.js +10 -1
  14. package/lib/mcfunction/inlayHintProvider.js +2 -1
  15. package/lib/mcfunction/node/argument.d.ts +2 -2
  16. package/lib/mcfunction/parser/argument.js +19 -10
  17. package/lib/mcfunction/tree/argument.d.ts +19 -1
  18. package/lib/mcfunction/tree/patch.js +39 -1
  19. package/package.json +7 -7
  20. package/lib/json/checker/data/advancement.d.ts +0 -14
  21. package/lib/json/checker/data/advancement.js +0 -458
  22. package/lib/json/checker/data/biome.d.ts +0 -4
  23. package/lib/json/checker/data/biome.js +0 -148
  24. package/lib/json/checker/data/common.d.ts +0 -22
  25. package/lib/json/checker/data/common.js +0 -278
  26. package/lib/json/checker/data/dimension.d.ts +0 -4
  27. package/lib/json/checker/data/dimension.js +0 -224
  28. package/lib/json/checker/data/feature.d.ts +0 -9
  29. package/lib/json/checker/data/feature.js +0 -748
  30. package/lib/json/checker/data/index.d.ts +0 -4
  31. package/lib/json/checker/data/index.js +0 -40
  32. package/lib/json/checker/data/loot_table.d.ts +0 -8
  33. package/lib/json/checker/data/loot_table.js +0 -295
  34. package/lib/json/checker/data/recipe.d.ts +0 -2
  35. package/lib/json/checker/data/recipe.js +0 -50
  36. package/lib/json/checker/data/structure.d.ts +0 -8
  37. package/lib/json/checker/data/structure.js +0 -155
  38. package/lib/json/checker/data/tag.d.ts +0 -7
  39. package/lib/json/checker/data/tag.js +0 -35
  40. package/lib/json/checker/data/text_component.d.ts +0 -2
  41. package/lib/json/checker/data/text_component.js +0 -155
  42. package/lib/json/checker/util/advancement.d.ts +0 -3
  43. package/lib/json/checker/util/advancement.js +0 -17
  44. package/lib/json/checker/util/block_states.d.ts +0 -13
  45. package/lib/json/checker/util/block_states.js +0 -63
  46. package/lib/json/checker/util/color.d.ts +0 -4
  47. package/lib/json/checker/util/color.js +0 -65
  48. package/lib/json/checker/util/index.d.ts +0 -8
  49. package/lib/json/checker/util/index.js +0 -8
  50. package/lib/json/checker/util/nbt.d.ts +0 -16
  51. package/lib/json/checker/util/nbt.js +0 -68
  52. package/lib/json/checker/util/recipe.d.ts +0 -6
  53. package/lib/json/checker/util/recipe.js +0 -13
  54. package/lib/json/checker/util/uuid.d.ts +0 -2
  55. package/lib/json/checker/util/uuid.js +0 -9
  56. package/lib/json/checker/util/version.d.ts +0 -46
  57. package/lib/json/checker/util/version.js +0 -48
@@ -1,4 +0,0 @@
1
- import type { JsonChecker } from '@spyglassmc/json/lib/checker/JsonChecker.js';
2
- export declare const pack_mcmeta: JsonChecker;
3
- export declare const Checkers: Map<"function" | "advancement" | "dimension" | "dimension_type" | "item_modifier" | "loot_table" | "predicate" | "recipe" | "structure" | "worldgen/biome" | "worldgen/configured_carver" | "worldgen/configured_feature" | "worldgen/configured_structure_feature" | "worldgen/configured_surface_builder" | "worldgen/density_function" | "worldgen/noise" | "worldgen/noise_settings" | "worldgen/placed_feature" | "worldgen/processor_list" | "worldgen/template_pool" | "tag/function" | "tag/activity" | "tag/attribute" | "tag/block" | "tag/block_entity_type" | "tag/block_predicate_type" | "tag/chunk_status" | "tag/custom_stat" | "tag/enchantment" | "tag/entity_type" | "tag/float_provider_type" | "tag/fluid" | "tag/game_event" | "tag/height_provider_type" | "tag/int_provider_type" | "tag/item" | "tag/loot_condition_type" | "tag/loot_function_type" | "tag/loot_nbt_provider_type" | "tag/loot_number_provider_type" | "tag/loot_pool_entry_type" | "tag/loot_score_provider_type" | "tag/memory_module_type" | "tag/menu" | "tag/mob_effect" | "tag/motive" | "tag/particle_type" | "tag/point_of_interest_type" | "tag/pos_rule_test" | "tag/position_source_type" | "tag/potion" | "tag/recipe_serializer" | "tag/recipe_type" | "tag/rule_test" | "tag/schedule" | "tag/sensor_type" | "tag/sound_event" | "tag/stat_type" | "tag/villager_profession" | "tag/villager_type" | "tag/worldgen/biome_source" | "tag/worldgen/block_placer_type" | "tag/worldgen/block_state_provider_type" | "tag/worldgen/carver" | "tag/worldgen/chunk_generator" | "tag/worldgen/decorator" | "tag/worldgen/feature" | "tag/worldgen/feature_size_type" | "tag/worldgen/foliage_placer_type" | "tag/worldgen/material_condition" | "tag/worldgen/material_rule" | "tag/worldgen/placement_modifier_type" | "tag/worldgen/structure_feature" | "tag/worldgen/structure_piece" | "tag/worldgen/structure_pool_element" | "tag/worldgen/structure_processor" | "tag/worldgen/surface_builder" | "tag/worldgen/tree_decorator_type" | "tag/worldgen/trunk_placer_type" | "tag/worldgen/biome" | "tag/worldgen/configured_carver" | "tag/worldgen/configured_feature" | "tag/worldgen/configured_structure_feature" | "tag/worldgen/configured_surface_builder" | "tag/worldgen/density_function" | "tag/worldgen/noise" | "tag/worldgen/noise_settings" | "tag/worldgen/placed_feature" | "tag/worldgen/processor_list" | "tag/worldgen/template_pool", JsonChecker>;
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,40 +0,0 @@
1
- import { as, int, record } from '@spyglassmc/json/lib/checker/index.js';
2
- import { advancement } from './advancement.js';
3
- import { biome, configured_carver, configured_surface_builder, } from './biome.js';
4
- import { dimension, dimension_type, noise_settings } from './dimension.js';
5
- import { configured_feature } from './feature.js';
6
- import { item_modifier_list, loot_table, predicate_list } from './loot_table.js';
7
- import { recipe } from './recipe.js';
8
- import { configured_structure_feature, processor_list, template_pool, } from './structure.js';
9
- import { block_tag, entity_type_tag, fluid_tag, function_tag, game_event_tag, item_tag, } from './tag.js';
10
- import { text_component } from './text_component.js';
11
- export const pack_mcmeta = as('pack', record({
12
- pack: record({
13
- pack_format: int,
14
- description: text_component,
15
- }),
16
- }, { allowUnknownProperties: true }));
17
- export const Checkers = new Map([
18
- ['advancement', advancement],
19
- ['dimension', dimension],
20
- ['dimension_type', dimension_type],
21
- ['item_modifier', item_modifier_list],
22
- ['loot_table', loot_table],
23
- ['predicate', predicate_list],
24
- ['recipe', recipe],
25
- ['tag/block', block_tag],
26
- ['tag/entity_type', entity_type_tag],
27
- ['tag/fluid', fluid_tag],
28
- ['tag/function', function_tag],
29
- ['tag/game_event', game_event_tag],
30
- ['tag/item', item_tag],
31
- ['worldgen/biome', biome],
32
- ['worldgen/configured_carver', configured_carver],
33
- ['worldgen/configured_surface_builder', configured_surface_builder],
34
- ['worldgen/configured_feature', configured_feature],
35
- ['worldgen/configured_structure_feature', configured_structure_feature],
36
- ['worldgen/noise_settings', noise_settings],
37
- ['worldgen/processor_list', processor_list],
38
- ['worldgen/template_pool', template_pool],
39
- ]);
40
- //# sourceMappingURL=index.js.map
@@ -1,8 +0,0 @@
1
- export declare const predicate: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
2
- export declare const predicate_list: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
3
- export declare const item_modifier: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
4
- export declare const item_modifier_list: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
5
- export declare const loot_entry: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
6
- export declare const loot_pool: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
7
- export declare const loot_table: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
8
- //# sourceMappingURL=loot_table.d.ts.map
@@ -1,295 +0,0 @@
1
- import { any, as, boolean, dispatch, extract, float, floatRange, int, intRange, listOf, literal, object, opt, pick, record, resource, simpleString, } from '@spyglassmc/json/lib/checker/primitives/index.js';
2
- import { blockStateList, blockStateMap, nbt, nbtPath, uuid, versioned, } from '../util/index.js';
3
- import { damage_source_predicate, entity_predicate, item_predicate, location_predicate, } from './advancement.js';
4
- import { int_bounds, nbt_provider, number_provider, Slots } from './common.js';
5
- import { text_component } from './text_component.js';
6
- const loot_context_types = [
7
- 'empty',
8
- 'chest',
9
- 'command',
10
- 'selector',
11
- 'fishing',
12
- 'entity',
13
- 'gift',
14
- 'barter',
15
- 'advancement_reward',
16
- 'advancement_entity',
17
- 'generic',
18
- 'block',
19
- ];
20
- const map_decorations = [
21
- 'mansion',
22
- 'monument',
23
- 'player',
24
- 'frame',
25
- 'red_marker',
26
- 'blue_marker',
27
- 'target_x',
28
- 'target_point',
29
- 'player_off_map',
30
- 'player_off_limits',
31
- 'red_x',
32
- 'banner_white',
33
- 'banner_orange',
34
- 'banner_magenta',
35
- 'banner_light_blue',
36
- 'banner_yellow',
37
- 'banner_lime',
38
- 'banner_pink',
39
- 'banner_gray',
40
- 'banner_light_gray',
41
- 'banner_cyan',
42
- 'banner_purple',
43
- 'banner_blue',
44
- 'banner_brown',
45
- 'banner_green',
46
- 'banner_red',
47
- 'banner_black',
48
- ];
49
- export const predicate = as('predicate', dispatch('condition', (condition, props) => record({
50
- condition: resource('loot_condition_type'),
51
- ...pick(condition, {
52
- alternative: {
53
- terms: listOf(predicate),
54
- },
55
- block_state_property: {
56
- block: resource('block'),
57
- properties: blockStateMap({ id: extract('block', props) }),
58
- },
59
- damage_source_properties: {
60
- predicate: damage_source_predicate,
61
- },
62
- entity_properties: {
63
- entity: literal([
64
- 'this',
65
- 'killer',
66
- 'killer_player',
67
- 'direct_killer',
68
- ]),
69
- predicate: entity_predicate,
70
- },
71
- entity_scores: {
72
- entity: literal([
73
- 'this',
74
- 'killer',
75
- 'killer_player',
76
- 'direct_killer',
77
- ]),
78
- scores: object(literal('objective'), () => int_bounds),
79
- },
80
- inverted: {
81
- term: predicate,
82
- },
83
- killed_by_player: {
84
- inverse: opt(boolean, false),
85
- },
86
- location_check: {
87
- offsetX: opt(int, 0),
88
- offsetY: opt(int, 0),
89
- offsetZ: opt(int, 0),
90
- predicate: location_predicate,
91
- },
92
- match_tool: {
93
- predicate: item_predicate,
94
- },
95
- random_chance: {
96
- chance: floatRange(0, 1),
97
- },
98
- random_chance_with_looting: {
99
- chance: floatRange(0, 1),
100
- looting_multiplier: float,
101
- },
102
- reference: {
103
- name: resource('predicate'),
104
- },
105
- table_bonus: {
106
- enchantment: resource('enchantment'),
107
- chances: listOf(floatRange(0, 1)),
108
- },
109
- time_check: {
110
- value: int_bounds,
111
- period: opt(int),
112
- },
113
- value_check: {
114
- value: number_provider,
115
- range: int_bounds,
116
- },
117
- weather_check: {
118
- raining: opt(boolean),
119
- thundering: opt(boolean),
120
- },
121
- }),
122
- })));
123
- export const predicate_list = any([predicate, listOf(predicate)]);
124
- export const item_modifier = as('item_modifier', dispatch('function', (function_, props, ctx) => record({
125
- function: resource('loot_function_type'),
126
- ...pick(function_, {
127
- apply_bonus: {
128
- enchantment: resource('enchantment'),
129
- formula: resource([
130
- 'binomial_with_bonus_count',
131
- 'ore_drops',
132
- 'uniform_bonus_count',
133
- ]),
134
- ...pick(extract('formula', props), {
135
- binomial_with_bonus_count: {
136
- parameters: record({
137
- extra: float,
138
- probability: floatRange(0, 1),
139
- }),
140
- },
141
- uniform_bonus_count: {
142
- parameters: record({
143
- bonusMultiplier: float,
144
- }),
145
- },
146
- }),
147
- },
148
- copy_name: {
149
- source: literal([
150
- 'this',
151
- 'killer',
152
- 'killer_player',
153
- 'block_entity',
154
- ]),
155
- },
156
- copy_nbt: {
157
- source: nbt_provider,
158
- ops: listOf(record({
159
- source: nbtPath({ registry: 'entity_type' }),
160
- target: nbtPath({ registry: 'item' }),
161
- op: literal(['replace', 'append', 'merge']),
162
- })),
163
- },
164
- copy_state: {
165
- block: resource('block'),
166
- properties: blockStateList({ id: extract('block', props) }),
167
- },
168
- enchant_randomly: {
169
- enchantments: opt(listOf(resource('enchantment'))),
170
- },
171
- enchant_with_levels: {
172
- levels: number_provider,
173
- treasure: opt(boolean, false),
174
- },
175
- exploration_map: {
176
- destination: opt(resource('worldgen/structure_feature'), 'buried_treasure'),
177
- decoration: opt(literal(map_decorations), 'mansion'),
178
- zoom: opt(int, 2),
179
- search_radius: opt(int, 50),
180
- skip_existing_chunks: opt(boolean, true),
181
- },
182
- fill_player_head: {
183
- entity: literal([
184
- 'this',
185
- 'killer',
186
- 'killer_player',
187
- 'direct_killer',
188
- ]),
189
- },
190
- limit_count: {
191
- limit: int_bounds,
192
- },
193
- looting_enchant: {
194
- count: number_provider,
195
- limit: opt(int, 0),
196
- },
197
- set_attributes: {
198
- modifiers: listOf(record({
199
- attribute: resource('attribute'),
200
- name: simpleString,
201
- operation: literal([
202
- 'addition',
203
- 'multiply_base',
204
- 'multiply_total',
205
- ]),
206
- id: opt(uuid),
207
- amount: number_provider,
208
- slot: any([literal(Slots), listOf(literal(Slots))]),
209
- })),
210
- },
211
- set_contents: {
212
- type: versioned(ctx, '1.18', resource('block_entity_type')),
213
- entries: listOf(loot_entry),
214
- },
215
- set_count: {
216
- count: number_provider,
217
- add: opt(versioned(ctx, '1.17', boolean), false),
218
- },
219
- set_damage: {
220
- damage: number_provider,
221
- add: opt(versioned(ctx, '1.17', boolean), false),
222
- },
223
- set_loot_table: {
224
- name: resource('loot_table'),
225
- seed: opt(int, 0),
226
- },
227
- set_lore: {
228
- entity: opt(literal(['this', 'killer', 'killer_player', 'direct_killer'])),
229
- lore: listOf(text_component),
230
- replace: opt(boolean, false),
231
- },
232
- set_name: {
233
- entity: opt(literal(['this', 'killer', 'killer_player', 'direct_killer'])),
234
- name: opt(text_component),
235
- },
236
- set_nbt: {
237
- tag: nbt({ registry: 'item' }),
238
- },
239
- set_potion: {
240
- id: resource('potion'),
241
- },
242
- set_stew_effect: {
243
- effects: opt(listOf(record({
244
- type: resource('mob_effect'),
245
- duration: number_provider,
246
- })), []),
247
- },
248
- }),
249
- conditions: opt(listOf(predicate)),
250
- })));
251
- export const item_modifier_list = any([item_modifier, listOf(item_modifier)]);
252
- export const loot_entry = as('loot_entry', dispatch('type', (type) => record({
253
- type: resource('loot_pool_entry_type'),
254
- weight: opt(intRange(1, undefined), 1),
255
- quality: opt(int, 0),
256
- ...pick(type, {
257
- alternatives: {
258
- children: listOf(loot_entry),
259
- },
260
- dynamic: {
261
- name: resource(['contents']),
262
- },
263
- group: {
264
- children: listOf(loot_entry),
265
- },
266
- item: {
267
- name: resource('item'),
268
- },
269
- loot_table: {
270
- name: resource('loot_table'),
271
- },
272
- sequence: {
273
- children: listOf(loot_entry),
274
- },
275
- tag: {
276
- name: resource('tag/item'),
277
- expand: boolean,
278
- },
279
- }),
280
- functions: opt(listOf(item_modifier), []),
281
- conditions: opt(listOf(predicate), []),
282
- })));
283
- export const loot_pool = as('loot_pool', record({
284
- rolls: number_provider,
285
- bonus_rolls: opt(number_provider, 0),
286
- entries: listOf(loot_entry),
287
- functions: opt(listOf(item_modifier), []),
288
- conditions: opt(listOf(predicate), []),
289
- }));
290
- export const loot_table = as('loot_table', record({
291
- type: opt(resource(loot_context_types)),
292
- pools: opt(listOf(loot_pool), []),
293
- functions: opt(listOf(item_modifier), []),
294
- }));
295
- //# sourceMappingURL=loot_table.js.map
@@ -1,2 +0,0 @@
1
- export declare const recipe: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
2
- //# sourceMappingURL=recipe.d.ts.map
@@ -1,50 +0,0 @@
1
- import { any, as, dispatch, float, int, intRange, listOf, object, opt, pick, record, resource, simpleString, when, } from '@spyglassmc/json/lib/checker/primitives/index.js';
2
- import { patternKeys, recipeGroup } from '../util/index.js';
3
- const one_recipe_ingredient = any([
4
- record({
5
- item: resource('item'),
6
- }),
7
- record({
8
- tag: resource('tag/item'),
9
- }),
10
- ]);
11
- const recipe_ingredient = any([
12
- one_recipe_ingredient,
13
- listOf(one_recipe_ingredient),
14
- ]);
15
- const recipe_result = record({
16
- item: resource('item'),
17
- count: opt(intRange(1, 64), 1),
18
- });
19
- export const recipe = as('recipe', dispatch('type', (type, props) => record({
20
- type: resource('recipe_serializer'),
21
- group: opt(recipeGroup),
22
- ...pick(type, {
23
- crafting_shaped: {
24
- pattern: listOf(simpleString),
25
- key: object(patternKeys(props), () => recipe_ingredient),
26
- result: recipe_result,
27
- },
28
- crafting_shapeless: {
29
- ingredients: listOf(recipe_ingredient),
30
- result: recipe_result,
31
- },
32
- stonecutting: {
33
- ingredient: recipe_ingredient,
34
- result: resource('item'),
35
- count: int,
36
- },
37
- smithing: {
38
- base: one_recipe_ingredient,
39
- addition: one_recipe_ingredient,
40
- result: recipe_result,
41
- },
42
- }),
43
- ...when(type, ['blasting', 'campfire_cooking', 'smelting', 'smoking'], {
44
- ingredient: recipe_ingredient,
45
- result: resource('item'),
46
- experience: opt(float, 0),
47
- cookingtime: opt(int, type === 'smelting' ? 200 : 100),
48
- }),
49
- })));
50
- //# sourceMappingURL=recipe.js.map
@@ -1,8 +0,0 @@
1
- export declare const rule_test: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
2
- export declare const pos_rule_test: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
3
- export declare const processor_list: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
4
- export declare const processor_list_ref: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
5
- export declare const template_pool: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
6
- export declare const template_pool_ref: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
7
- export declare const configured_structure_feature: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
8
- //# sourceMappingURL=structure.d.ts.map
@@ -1,155 +0,0 @@
1
- import { any, as, boolean, dispatch, extractNested, float, floatRange, intRange, listOf, literal, opt, pick, record, resource, simpleString, when, } from '@spyglassmc/json/lib/checker/index.js';
2
- import { nbt, versioned } from '../util/index.js';
3
- import { block_state, height_provider, HeightmapType } from './common.js';
4
- import { configured_feature_ref, placed_feature_ref } from './feature.js';
5
- export const rule_test = as('rule_test', dispatch('predicate_type', (type) => record({
6
- predicate_type: resource('rule_test'),
7
- ...pick(type, {
8
- block_match: {
9
- block: resource('block'),
10
- },
11
- blockstate_match: {
12
- block_state: block_state,
13
- },
14
- random_block_match: {
15
- block: resource('block'),
16
- probability: floatRange(0, 1),
17
- },
18
- random_blockstate_match: {
19
- block_state: block_state,
20
- probability: floatRange(0, 1),
21
- },
22
- tag_match: {
23
- tag: resource('tag/block'),
24
- },
25
- }),
26
- })));
27
- export const pos_rule_test = as('pos_rule_test', dispatch('predicate_type', (type) => record({
28
- predicate_type: resource('pos_rule_test'),
29
- ...pick(type, {
30
- axis_aligned_linear_pos: {
31
- axis: literal(['x', 'y', 'z']),
32
- min_dist: opt(intRange(0, 255)),
33
- max_dist: opt(intRange(0, 255)),
34
- min_chance: opt(floatRange(0, 1)),
35
- max_chance: opt(floatRange(0, 1)),
36
- },
37
- }),
38
- ...when(type, ['axis_aligned_linear_pos', 'linear_pos'], {}),
39
- })));
40
- const processor_rule = as('processor_rule', dispatch((props) => record({
41
- position_predicate: opt(pos_rule_test, {
42
- predicate_type: 'always_true',
43
- }),
44
- input_predicate: rule_test,
45
- location_predicate: rule_test,
46
- output_state: block_state,
47
- output_nbt: opt(nbt({
48
- registry: 'block',
49
- id: extractNested('output_state', 'Name', props),
50
- })),
51
- })));
52
- const processor = as('processor', dispatch('processor_type', (type) => record({
53
- processor_type: resource('worldgen/structure_processor'),
54
- ...pick(type, {
55
- block_age: {
56
- mossiness: float,
57
- },
58
- block_ignore: {
59
- blocks: listOf(block_state),
60
- },
61
- block_rot: {
62
- integrity: floatRange(0, 1),
63
- },
64
- gravity: {
65
- heightmap: literal(HeightmapType),
66
- },
67
- protected_blocks: {
68
- value: resource('tag/block'),
69
- },
70
- rule: {
71
- rules: listOf(processor_rule),
72
- },
73
- }),
74
- })));
75
- export const processor_list = as('processor_list', any([
76
- record({
77
- processors: listOf(processor),
78
- }),
79
- listOf(processor),
80
- ]));
81
- export const processor_list_ref = as('processor_list', any([resource('worldgen/processor_list'), processor_list]));
82
- const template_element = as('template_element', dispatch('element_type', (type, _, ctx) => record({
83
- element_type: resource('worldgen/structure_pool_element'),
84
- ...when(type, ['empty_pool_element'], {}, {
85
- projection: literal(['rigid', 'terrain_matching']),
86
- }),
87
- ...pick(type, {
88
- feature_pool_element: {
89
- feature: versioned(ctx, configured_feature_ref, '1.18', placed_feature_ref),
90
- },
91
- legacy_single_pool_element: {
92
- location: resource('structure'),
93
- processors: processor_list_ref,
94
- },
95
- list_pool_element: {
96
- elements: listOf(template_element),
97
- },
98
- single_pool_element: {
99
- location: resource('structure'),
100
- processors: processor_list_ref,
101
- },
102
- }),
103
- })));
104
- export const template_pool = as('template_pool', record({
105
- name: simpleString,
106
- fallback: resource('worldgen/template_pool'),
107
- elements: listOf(record({
108
- weight: intRange(1, undefined),
109
- element: template_element,
110
- })),
111
- }));
112
- export const template_pool_ref = any([
113
- resource('worldgen/template_pool'),
114
- template_pool,
115
- ]);
116
- export const configured_structure_feature = as('structure_feature', dispatch('type', (type) => record({
117
- type: resource('worldgen/structure_feature'),
118
- config: record({
119
- ...when(type, ['bastion_remnant', 'pillager_outpost', 'village'], {
120
- start_pool: template_pool_ref,
121
- size: intRange(0, 7),
122
- }, pick(type, {
123
- buried_treasure: {
124
- probability: floatRange(0, 1),
125
- },
126
- mineshaft: {
127
- type: literal(['normal', 'mesa']),
128
- probability: floatRange(0, 1),
129
- },
130
- nether_fossil: {
131
- height: height_provider,
132
- },
133
- ocean_ruin: {
134
- biome_temp: literal(['cold', 'warm']),
135
- large_probability: floatRange(0, 1),
136
- cluster_probability: floatRange(0, 1),
137
- },
138
- ruined_portal: {
139
- portal_type: literal([
140
- 'standard',
141
- 'desert',
142
- 'jungle',
143
- 'mountain',
144
- 'nether',
145
- 'ocean',
146
- 'swamp',
147
- ]),
148
- },
149
- shipwreck: {
150
- is_beached: opt(boolean, false),
151
- },
152
- })),
153
- }),
154
- })));
155
- //# sourceMappingURL=structure.js.map
@@ -1,7 +0,0 @@
1
- export declare const block_tag: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
2
- export declare const entity_type_tag: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
3
- export declare const fluid_tag: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
4
- export declare const function_tag: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
5
- export declare const game_event_tag: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
6
- export declare const item_tag: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
7
- //# sourceMappingURL=tag.d.ts.map
@@ -1,35 +0,0 @@
1
- import { ResourceLocation } from '@spyglassmc/core';
2
- import { JsonObjectNode, JsonStringNode } from '@spyglassmc/json';
3
- import { any, boolean, opt, record, resource, uniqueListOf, } from '@spyglassmc/json/lib/checker/primitives/index.js';
4
- import { localize } from '@spyglassmc/locales';
5
- const tag = (type) => record({
6
- replace: opt(boolean, false),
7
- values: uniqueListOf(any([
8
- resource(type, true),
9
- record({
10
- id: resource(type, true),
11
- required: opt(boolean, true),
12
- }),
13
- ]), {
14
- items: (node) => {
15
- if (JsonStringNode.is(node)) {
16
- return [ResourceLocation.shorten(node.value), node];
17
- }
18
- if (JsonObjectNode.is(node)) {
19
- const id = node.children.find((c) => c.key?.value === 'id');
20
- if (id && id.value && JsonStringNode.is(id.value)) {
21
- return [ResourceLocation.shorten(id.value.value), id.value];
22
- }
23
- }
24
- return [undefined, node];
25
- },
26
- report: (node, ctx) => ctx.err.report(localize('json.checker.tag-entry.duplicate'), node, 2 /* ErrorSeverity.Warning */),
27
- }),
28
- });
29
- export const block_tag = tag('block');
30
- export const entity_type_tag = tag('entity_type');
31
- export const fluid_tag = tag('fluid');
32
- export const function_tag = tag('function');
33
- export const game_event_tag = tag('game_event');
34
- export const item_tag = tag('item');
35
- //# sourceMappingURL=tag.js.map
@@ -1,2 +0,0 @@
1
- export declare const text_component: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
2
- //# sourceMappingURL=text_component.d.ts.map