@spyglassmc/java-edition 0.3.2 → 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.
Files changed (60) hide show
  1. package/lib/binder/index.d.ts +1 -1
  2. package/lib/binder/index.js +21 -5
  3. package/lib/dependency/common.d.ts +1 -5
  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 +4 -4
  8. package/lib/dependency/mcmeta.js +50 -17
  9. package/lib/index.js +6 -1
  10. package/lib/json/checker/index.js +2 -1
  11. package/lib/mcfunction/checker/index.js +5 -6
  12. package/lib/mcfunction/common/index.d.ts +4 -0
  13. package/lib/mcfunction/common/index.js +25 -0
  14. package/lib/mcfunction/completer/argument.js +10 -1
  15. package/lib/mcfunction/index.js +13 -1
  16. package/lib/mcfunction/inlayHintProvider.js +2 -1
  17. package/lib/mcfunction/node/argument.d.ts +5 -5
  18. package/lib/mcfunction/parser/argument.js +56 -24
  19. package/lib/mcfunction/signatureHelpProvider.js +3 -1
  20. package/lib/mcfunction/tree/argument.d.ts +19 -1
  21. package/lib/mcfunction/tree/patch.js +39 -1
  22. package/package.json +7 -7
  23. package/lib/json/checker/data/advancement.d.ts +0 -14
  24. package/lib/json/checker/data/advancement.js +0 -458
  25. package/lib/json/checker/data/biome.d.ts +0 -4
  26. package/lib/json/checker/data/biome.js +0 -148
  27. package/lib/json/checker/data/common.d.ts +0 -22
  28. package/lib/json/checker/data/common.js +0 -267
  29. package/lib/json/checker/data/dimension.d.ts +0 -4
  30. package/lib/json/checker/data/dimension.js +0 -224
  31. package/lib/json/checker/data/feature.d.ts +0 -9
  32. package/lib/json/checker/data/feature.js +0 -744
  33. package/lib/json/checker/data/index.d.ts +0 -4
  34. package/lib/json/checker/data/index.js +0 -40
  35. package/lib/json/checker/data/loot_table.d.ts +0 -8
  36. package/lib/json/checker/data/loot_table.js +0 -275
  37. package/lib/json/checker/data/recipe.d.ts +0 -2
  38. package/lib/json/checker/data/recipe.js +0 -50
  39. package/lib/json/checker/data/structure.d.ts +0 -8
  40. package/lib/json/checker/data/structure.js +0 -153
  41. package/lib/json/checker/data/tag.d.ts +0 -7
  42. package/lib/json/checker/data/tag.js +0 -35
  43. package/lib/json/checker/data/text_component.d.ts +0 -2
  44. package/lib/json/checker/data/text_component.js +0 -148
  45. package/lib/json/checker/util/advancement.d.ts +0 -3
  46. package/lib/json/checker/util/advancement.js +0 -16
  47. package/lib/json/checker/util/block_states.d.ts +0 -13
  48. package/lib/json/checker/util/block_states.js +0 -63
  49. package/lib/json/checker/util/color.d.ts +0 -4
  50. package/lib/json/checker/util/color.js +0 -65
  51. package/lib/json/checker/util/index.d.ts +0 -8
  52. package/lib/json/checker/util/index.js +0 -8
  53. package/lib/json/checker/util/nbt.d.ts +0 -16
  54. package/lib/json/checker/util/nbt.js +0 -67
  55. package/lib/json/checker/util/recipe.d.ts +0 -6
  56. package/lib/json/checker/util/recipe.js +0 -13
  57. package/lib/json/checker/util/uuid.d.ts +0 -2
  58. package/lib/json/checker/util/uuid.js +0 -9
  59. package/lib/json/checker/util/version.d.ts +0 -46
  60. 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,275 +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(['this', 'killer', 'killer_player', 'direct_killer']),
64
- predicate: entity_predicate,
65
- },
66
- entity_scores: {
67
- entity: literal(['this', 'killer', 'killer_player', 'direct_killer']),
68
- scores: object(literal('objective'), () => int_bounds),
69
- },
70
- inverted: {
71
- term: predicate,
72
- },
73
- killed_by_player: {
74
- inverse: opt(boolean, false),
75
- },
76
- location_check: {
77
- offsetX: opt(int, 0),
78
- offsetY: opt(int, 0),
79
- offsetZ: opt(int, 0),
80
- predicate: location_predicate,
81
- },
82
- match_tool: {
83
- predicate: item_predicate,
84
- },
85
- random_chance: {
86
- chance: floatRange(0, 1),
87
- },
88
- random_chance_with_looting: {
89
- chance: floatRange(0, 1),
90
- looting_multiplier: float,
91
- },
92
- reference: {
93
- name: resource('predicate'),
94
- },
95
- table_bonus: {
96
- enchantment: resource('enchantment'),
97
- chances: listOf(floatRange(0, 1)),
98
- },
99
- time_check: {
100
- value: int_bounds,
101
- period: opt(int),
102
- },
103
- value_check: {
104
- value: number_provider,
105
- range: int_bounds,
106
- },
107
- weather_check: {
108
- raining: opt(boolean),
109
- thundering: opt(boolean),
110
- },
111
- }),
112
- })));
113
- export const predicate_list = any([predicate, listOf(predicate)]);
114
- export const item_modifier = as('item_modifier', dispatch('function', (function_, props, ctx) => record({
115
- function: resource('loot_function_type'),
116
- ...pick(function_, {
117
- apply_bonus: {
118
- enchantment: resource('enchantment'),
119
- formula: resource([
120
- 'binomial_with_bonus_count',
121
- 'ore_drops',
122
- 'uniform_bonus_count',
123
- ]),
124
- ...pick(extract('formula', props), {
125
- binomial_with_bonus_count: {
126
- parameters: record({
127
- extra: float,
128
- probability: floatRange(0, 1),
129
- }),
130
- },
131
- uniform_bonus_count: {
132
- parameters: record({
133
- bonusMultiplier: float,
134
- }),
135
- },
136
- }),
137
- },
138
- copy_name: {
139
- source: literal(['this', 'killer', 'killer_player', 'block_entity']),
140
- },
141
- copy_nbt: {
142
- source: nbt_provider,
143
- ops: listOf(record({
144
- source: nbtPath({ registry: 'entity_type' }),
145
- target: nbtPath({ registry: 'item' }),
146
- op: literal(['replace', 'append', 'merge']),
147
- })),
148
- },
149
- copy_state: {
150
- block: resource('block'),
151
- properties: blockStateList({ id: extract('block', props) }),
152
- },
153
- enchant_randomly: {
154
- enchantments: opt(listOf(resource('enchantment'))),
155
- },
156
- enchant_with_levels: {
157
- levels: number_provider,
158
- treasure: opt(boolean, false),
159
- },
160
- exploration_map: {
161
- destination: opt(resource('worldgen/structure_feature'), 'buried_treasure'),
162
- decoration: opt(literal(map_decorations), 'mansion'),
163
- zoom: opt(int, 2),
164
- search_radius: opt(int, 50),
165
- skip_existing_chunks: opt(boolean, true),
166
- },
167
- fill_player_head: {
168
- entity: literal(['this', 'killer', 'killer_player', 'direct_killer']),
169
- },
170
- limit_count: {
171
- limit: int_bounds,
172
- },
173
- looting_enchant: {
174
- count: number_provider,
175
- limit: opt(int, 0),
176
- },
177
- set_attributes: {
178
- modifiers: listOf(record({
179
- attribute: resource('attribute'),
180
- name: simpleString,
181
- operation: literal([
182
- 'addition',
183
- 'multiply_base',
184
- 'multiply_total',
185
- ]),
186
- id: opt(uuid),
187
- amount: number_provider,
188
- slot: any([literal(Slots), listOf(literal(Slots))]),
189
- })),
190
- },
191
- set_contents: {
192
- type: versioned(ctx, '1.18', resource('block_entity_type')),
193
- entries: listOf(loot_entry),
194
- },
195
- set_count: {
196
- count: number_provider,
197
- add: opt(versioned(ctx, '1.17', boolean), false),
198
- },
199
- set_damage: {
200
- damage: number_provider,
201
- add: opt(versioned(ctx, '1.17', boolean), false),
202
- },
203
- set_loot_table: {
204
- name: resource('loot_table'),
205
- seed: opt(int, 0),
206
- },
207
- set_lore: {
208
- entity: opt(literal(['this', 'killer', 'killer_player', 'direct_killer'])),
209
- lore: listOf(text_component),
210
- replace: opt(boolean, false),
211
- },
212
- set_name: {
213
- entity: opt(literal(['this', 'killer', 'killer_player', 'direct_killer'])),
214
- name: opt(text_component),
215
- },
216
- set_nbt: {
217
- tag: nbt({ registry: 'item' }),
218
- },
219
- set_potion: {
220
- id: resource('potion'),
221
- },
222
- set_stew_effect: {
223
- effects: opt(listOf(record({
224
- type: resource('mob_effect'),
225
- duration: number_provider,
226
- })), []),
227
- },
228
- }),
229
- conditions: opt(listOf(predicate)),
230
- })));
231
- export const item_modifier_list = any([item_modifier, listOf(item_modifier)]);
232
- export const loot_entry = as('loot_entry', dispatch('type', (type) => record({
233
- type: resource('loot_pool_entry_type'),
234
- weight: opt(intRange(1, undefined), 1),
235
- quality: opt(int, 0),
236
- ...pick(type, {
237
- alternatives: {
238
- children: listOf(loot_entry),
239
- },
240
- dynamic: {
241
- name: resource(['contents']),
242
- },
243
- group: {
244
- children: listOf(loot_entry),
245
- },
246
- item: {
247
- name: resource('item'),
248
- },
249
- loot_table: {
250
- name: resource('loot_table'),
251
- },
252
- sequence: {
253
- children: listOf(loot_entry),
254
- },
255
- tag: {
256
- name: resource('tag/item'),
257
- expand: boolean,
258
- },
259
- }),
260
- functions: opt(listOf(item_modifier), []),
261
- conditions: opt(listOf(predicate), []),
262
- })));
263
- export const loot_pool = as('loot_pool', record({
264
- rolls: number_provider,
265
- bonus_rolls: opt(number_provider, 0),
266
- entries: listOf(loot_entry),
267
- functions: opt(listOf(item_modifier), []),
268
- conditions: opt(listOf(predicate), []),
269
- }));
270
- export const loot_table = as('loot_table', record({
271
- type: opt(resource(loot_context_types)),
272
- pools: opt(listOf(loot_pool), []),
273
- functions: opt(listOf(item_modifier), []),
274
- }));
275
- //# 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,153 +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, HeightmapType, height_provider } 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, { predicate_type: 'always_true' }),
42
- input_predicate: rule_test,
43
- location_predicate: rule_test,
44
- output_state: block_state,
45
- output_nbt: opt(nbt({
46
- registry: 'block',
47
- id: extractNested('output_state', 'Name', props),
48
- })),
49
- })));
50
- const processor = as('processor', dispatch('processor_type', (type) => record({
51
- processor_type: resource('worldgen/structure_processor'),
52
- ...pick(type, {
53
- block_age: {
54
- mossiness: float,
55
- },
56
- block_ignore: {
57
- blocks: listOf(block_state),
58
- },
59
- block_rot: {
60
- integrity: floatRange(0, 1),
61
- },
62
- gravity: {
63
- heightmap: literal(HeightmapType),
64
- },
65
- protected_blocks: {
66
- value: resource('tag/block'),
67
- },
68
- rule: {
69
- rules: listOf(processor_rule),
70
- },
71
- }),
72
- })));
73
- export const processor_list = as('processor_list', any([
74
- record({
75
- processors: listOf(processor),
76
- }),
77
- listOf(processor),
78
- ]));
79
- export const processor_list_ref = as('processor_list', any([resource('worldgen/processor_list'), processor_list]));
80
- const template_element = as('template_element', dispatch('element_type', (type, _, ctx) => record({
81
- element_type: resource('worldgen/structure_pool_element'),
82
- ...when(type, ['empty_pool_element'], {}, {
83
- projection: literal(['rigid', 'terrain_matching']),
84
- }),
85
- ...pick(type, {
86
- feature_pool_element: {
87
- feature: versioned(ctx, configured_feature_ref, '1.18', placed_feature_ref),
88
- },
89
- legacy_single_pool_element: {
90
- location: resource('structure'),
91
- processors: processor_list_ref,
92
- },
93
- list_pool_element: {
94
- elements: listOf(template_element),
95
- },
96
- single_pool_element: {
97
- location: resource('structure'),
98
- processors: processor_list_ref,
99
- },
100
- }),
101
- })));
102
- export const template_pool = as('template_pool', record({
103
- name: simpleString,
104
- fallback: resource('worldgen/template_pool'),
105
- elements: listOf(record({
106
- weight: intRange(1, undefined),
107
- element: template_element,
108
- })),
109
- }));
110
- export const template_pool_ref = any([
111
- resource('worldgen/template_pool'),
112
- template_pool,
113
- ]);
114
- export const configured_structure_feature = as('structure_feature', dispatch('type', (type) => record({
115
- type: resource('worldgen/structure_feature'),
116
- config: record({
117
- ...when(type, ['bastion_remnant', 'pillager_outpost', 'village'], {
118
- start_pool: template_pool_ref,
119
- size: intRange(0, 7),
120
- }, pick(type, {
121
- buried_treasure: {
122
- probability: floatRange(0, 1),
123
- },
124
- mineshaft: {
125
- type: literal(['normal', 'mesa']),
126
- probability: floatRange(0, 1),
127
- },
128
- nether_fossil: {
129
- height: height_provider,
130
- },
131
- ocean_ruin: {
132
- biome_temp: literal(['cold', 'warm']),
133
- large_probability: floatRange(0, 1),
134
- cluster_probability: floatRange(0, 1),
135
- },
136
- ruined_portal: {
137
- portal_type: literal([
138
- 'standard',
139
- 'desert',
140
- 'jungle',
141
- 'mountain',
142
- 'nether',
143
- 'ocean',
144
- 'swamp',
145
- ]),
146
- },
147
- shipwreck: {
148
- is_beached: opt(boolean, false),
149
- },
150
- })),
151
- }),
152
- })));
153
- //# 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