@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.
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,278 +0,0 @@
1
- import { any, as, dispatch, extract, float, floatRange, int, intRange, listOf, literal, opt, pick, record, ref, resource, simpleString, } from '@spyglassmc/json/lib/checker/primitives/index.js';
2
- import { blockStateMap } from '../util/index.js';
3
- function smallestEncompassingPowerOfTwo(n) {
4
- n = n - 1;
5
- n |= n >> 1;
6
- n |= n >> 2;
7
- n |= n >> 4;
8
- n |= n >> 8;
9
- n |= n >> 16;
10
- return n + 1;
11
- }
12
- const BITS_FOR_Y = 64 -
13
- 2 * (1 + Math.log2(smallestEncompassingPowerOfTwo(30000000))); // 12
14
- export const Y_SIZE = (1 << BITS_FOR_Y) - 32; // 4064
15
- export const MAX_Y = (Y_SIZE >> 1) - 1; // 2031
16
- export const MIN_Y = MAX_Y - Y_SIZE + 1; // -2031
17
- export const number_provider = as('range', any([
18
- float,
19
- dispatch('type', (type) => record({
20
- type: opt(resource('loot_number_provider_type')),
21
- ...(type === undefined
22
- ? {
23
- min: number_provider,
24
- max: number_provider,
25
- }
26
- : {}),
27
- ...pick(type, {
28
- constant: {
29
- value: float,
30
- },
31
- uniform: {
32
- min: number_provider,
33
- max: number_provider,
34
- },
35
- binomial: {
36
- n: number_provider,
37
- p: number_provider,
38
- },
39
- score: {
40
- target: score_provider,
41
- score: literal('objective'),
42
- scale: opt(float),
43
- },
44
- }),
45
- })),
46
- ]));
47
- export const score_provider = any([
48
- literal(['this', 'killer', 'player_killer', 'direct_killer']),
49
- dispatch('type', (type) => record({
50
- type: resource('loot_score_provider_type'),
51
- ...pick(type, {
52
- context: {
53
- target: literal([
54
- 'this',
55
- 'killer',
56
- 'player_killer',
57
- 'direct_killer',
58
- ]),
59
- },
60
- fixed: {
61
- name: simpleString, // TODO: score holder, no selector
62
- },
63
- }),
64
- })),
65
- ]);
66
- export const nbt_provider = any([
67
- literal(['this', 'killer', 'killer_player', 'block_entity']),
68
- dispatch('type', (type) => record({
69
- type: resource('loot_nbt_provider_type'),
70
- ...pick(type, {
71
- context: {
72
- target: literal([
73
- 'this',
74
- 'killer',
75
- 'killer_player',
76
- 'block_entity',
77
- ]),
78
- },
79
- storage: {
80
- source: resource('storage'),
81
- },
82
- }),
83
- })),
84
- ]);
85
- export const int_bounds = as('bounds', any([
86
- int,
87
- any([
88
- record({
89
- min: int,
90
- max: opt(int),
91
- }),
92
- record({
93
- min: opt(int),
94
- max: int,
95
- }),
96
- ]),
97
- ]));
98
- export const float_bounds = as('bounds', any([
99
- float,
100
- any([
101
- record({
102
- min: float,
103
- max: opt(float),
104
- }),
105
- record({
106
- min: opt(float),
107
- max: float,
108
- }),
109
- ]),
110
- ]));
111
- export const block_state = as('block_state', dispatch((props) => record({
112
- Name: resource('block'),
113
- Properties: opt(blockStateMap({
114
- id: extract('Name', props),
115
- requireAll: true,
116
- })),
117
- })));
118
- export const fluid_state = as('fluid_state', dispatch((props) => record({
119
- Name: resource('fluid'),
120
- Properties: opt(blockStateMap({
121
- id: extract('Name', props),
122
- category: 'fluid',
123
- requireAll: true,
124
- })),
125
- })));
126
- export const vertical_anchor = as('vertical_anchor', any([
127
- record({
128
- absolute: intRange(MIN_Y, MAX_Y),
129
- }),
130
- record({
131
- above_bottom: intRange(MIN_Y, MAX_Y),
132
- }),
133
- record({
134
- below_top: intRange(MIN_Y, MAX_Y),
135
- }),
136
- ]));
137
- export const height_provider = as('height_provider', any([
138
- vertical_anchor,
139
- dispatch('type', (type) => record({
140
- type: resource('height_provider_type'),
141
- ...pick(type, {
142
- constant: {
143
- value: vertical_anchor,
144
- },
145
- uniform: {
146
- min_inclusive: vertical_anchor,
147
- max_inclusive: vertical_anchor,
148
- },
149
- biased_to_bottom: {
150
- min_inclusive: vertical_anchor,
151
- max_inclusive: vertical_anchor,
152
- inner: opt(intRange(1, undefined), 1),
153
- },
154
- very_biased_to_bottom: {
155
- min_inclusive: vertical_anchor,
156
- max_inclusive: vertical_anchor,
157
- inner: opt(intRange(1, undefined), 1),
158
- },
159
- trapezoid: {
160
- min_inclusive: vertical_anchor,
161
- max_inclusive: vertical_anchor,
162
- plateau: opt(int, 0),
163
- },
164
- weighted_list: {
165
- distribution: listOf(record({
166
- data: ref(() => height_provider),
167
- weight: int,
168
- })),
169
- },
170
- }),
171
- })),
172
- ]));
173
- export const floatProvider = (min = undefined, max = undefined) => as('float_provider', any([
174
- floatRange(min, max),
175
- dispatch('type', (type) => record({
176
- type: resource('float_provider_type'),
177
- ...pick(type, {
178
- constant: {
179
- value: floatRange(min, max),
180
- },
181
- uniform: {
182
- value: record({
183
- min_inclusive: floatRange(min, max),
184
- max_exclusive: floatRange(min, max),
185
- }),
186
- },
187
- clamped_normal: {
188
- value: record({
189
- mean: float,
190
- deviation: float,
191
- min: floatRange(min, max),
192
- max: floatRange(min, max),
193
- }),
194
- },
195
- trapezoid: {
196
- value: record({
197
- min: floatRange(min, max),
198
- max: floatRange(min, max),
199
- plateau: float,
200
- }),
201
- },
202
- }),
203
- })),
204
- ]));
205
- export const intProvider = (min = undefined, max = undefined) => as('int_provider', any([
206
- intRange(min, max),
207
- dispatch('type', (type) => record({
208
- type: resource('int_provider_type'),
209
- ...pick(type, {
210
- constant: {
211
- value: intRange(min, max),
212
- },
213
- uniform: {
214
- value: record({
215
- min_inclusive: intRange(min, max),
216
- max_inclusive: intRange(min, max),
217
- }),
218
- },
219
- biased_to_bottom: {
220
- value: record({
221
- min_inclusive: intRange(min, max),
222
- max_inclusive: intRange(min, max),
223
- }),
224
- },
225
- clamped: {
226
- value: record({
227
- min_inclusive: intRange(min, max),
228
- max_inclusive: intRange(min, max),
229
- source: ref(() => intProvider()),
230
- }),
231
- },
232
- clamped_normal: {
233
- value: record({
234
- mean: float,
235
- deviation: float,
236
- min_inclusive: intRange(min, max),
237
- max_inclusive: intRange(min, max),
238
- }),
239
- },
240
- weighted_list: {
241
- distribution: listOf(record({
242
- data: ref(() => intProvider()),
243
- weight: int,
244
- })),
245
- },
246
- }),
247
- })),
248
- ]));
249
- // until 1.16
250
- export const uniformInt = (min, max, maxSpread) => as('uniform_int', any([
251
- intRange(min, max),
252
- record({
253
- base: intRange(min, max),
254
- spread: intRange(0, maxSpread),
255
- }),
256
- ]));
257
- export const inclusiveRange = (min, max) => as('inclusive_range', any([
258
- record({
259
- min_inclusive: intRange(min, max),
260
- max_inclusive: intRange(min, max),
261
- }),
262
- listOf(intRange(min, max)),
263
- ]));
264
- export const noise_parameters = record({
265
- firstOctave: int,
266
- amplitudes: listOf(float),
267
- });
268
- export const HeightmapType = [
269
- 'MOTION_BLOCKING',
270
- 'MOTION_BLOCKING_NO_LEAVES',
271
- 'OCEAN_FLOOR',
272
- 'OCEAN_FLOOR_WG',
273
- 'WORLD_SURFACE',
274
- 'WORLD_SURFACE_WG',
275
- ];
276
- export const Slots = ['mainhand', 'offhand', 'head', 'chest', 'legs', 'feet'];
277
- export const Direction = ['up', 'down', 'north', 'east', 'south', 'west'];
278
- //# sourceMappingURL=common.js.map
@@ -1,4 +0,0 @@
1
- export declare const noise_settings: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
2
- export declare const dimension_type: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
3
- export declare const dimension: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
4
- //# sourceMappingURL=dimension.d.ts.map
@@ -1,224 +0,0 @@
1
- import { any, as, boolean, dispatch, float, floatRange, int, intRange, listOf, literal, object, opt, pick, record, ref, resource, simpleString, } from '@spyglassmc/json/lib/checker/primitives/index.js';
2
- import { versioned } from '../util/index.js';
3
- import { block_state, noise_parameters, vertical_anchor } from './common.js';
4
- const material_condition = as('material_condition', dispatch('type', (type) => record({
5
- type: resource('worldgen/material_condition'),
6
- ...pick(type, {
7
- biome: {
8
- biome_is: listOf(resource('worldgen/biome')),
9
- },
10
- noise_threshold: {
11
- noise: resource('worldgen/noise'),
12
- min_threshold: float,
13
- max_threshold: float,
14
- },
15
- not: {
16
- invert: material_condition,
17
- },
18
- stone_depth: {
19
- offset: int,
20
- surface_type: literal(['floor', 'ceiling']),
21
- add_surface_depth: boolean,
22
- add_surface_secondary_depth: boolean,
23
- },
24
- vertical_gradient: {
25
- random_name: simpleString,
26
- true_at_and_below: vertical_anchor,
27
- false_at_and_above: vertical_anchor,
28
- },
29
- water: {
30
- offset: int,
31
- surface_depth_multiplier: intRange(-20, 20),
32
- add_stone_depth: boolean,
33
- },
34
- y_above: {
35
- anchor: vertical_anchor,
36
- surface_depth_multiplier: intRange(-20, 20),
37
- add_stone_depth: boolean,
38
- },
39
- }),
40
- })));
41
- const material_rule = as('material_rule', dispatch('type', (type) => record({
42
- type: resource('worldgen/material_rule'),
43
- ...pick(type, {
44
- block: {
45
- result_state: block_state,
46
- },
47
- condition: {
48
- if_true: material_condition,
49
- then_run: material_rule,
50
- },
51
- sequence: {
52
- sequence: listOf(material_rule),
53
- },
54
- }),
55
- })));
56
- const terrain_spline = as('terrain_spline', any([
57
- float,
58
- record({
59
- coordinate: literal(['continents', 'erosion', 'weirdness', 'ridges']),
60
- points: listOf(record({
61
- location: float,
62
- value: ref(() => terrain_spline),
63
- derivative: float,
64
- })),
65
- }),
66
- ]));
67
- const structure_settings = as('structure_settings', record({
68
- stronghold: opt(record({
69
- distance: intRange(0, 1023),
70
- spread: intRange(0, 1023),
71
- count: intRange(1, 4095),
72
- })),
73
- structures: object(resource('worldgen/structure_feature'), () => record({
74
- spacing: intRange(0, 4096),
75
- separation: intRange(0, 4096),
76
- salt: intRange(0, undefined),
77
- })),
78
- }));
79
- const noise_slide_settings = dispatch((_, ctx) => record({
80
- target: float,
81
- size: versioned(ctx, int, '1.17', intRange(0, undefined)),
82
- offset: int,
83
- }));
84
- export const noise_settings = as('noise_settings', dispatch((_, ctx) => record({
85
- bedrock_roof_position: versioned(ctx, int, '1.18'),
86
- bedrock_floor_position: versioned(ctx, int, '1.18'),
87
- sea_level: int,
88
- min_surface_level: versioned(ctx, '1.17', versioned(ctx, int, '1.18')),
89
- disable_mob_generation: boolean,
90
- ...versioned(ctx, '1.17', {
91
- noise_caves_enabled: boolean,
92
- noodle_caves_enabled: boolean,
93
- aquifers_enabled: boolean,
94
- deepslate_enabled: versioned(ctx, boolean, '1.18'),
95
- ore_veins_enabled: boolean,
96
- }),
97
- legacy_random_source: versioned(ctx, '1.18', boolean),
98
- default_block: block_state,
99
- default_fluid: block_state,
100
- noise: record({
101
- min_y: versioned(ctx, '1.17', intRange(-2048, 2047)),
102
- height: intRange(0, 4096),
103
- size_horizontal: intRange(1, 4),
104
- size_vertical: intRange(1, 4),
105
- density_factor: versioned(ctx, float, '1.18'),
106
- density_offset: versioned(ctx, float, '1.18'),
107
- simplex_surface_noise: versioned(ctx, boolean, '1.18'),
108
- random_density_offset: opt(versioned(ctx, boolean, '1.18'), false),
109
- island_noise_override: opt(boolean, false),
110
- amplified: opt(boolean, false),
111
- large_biomes: opt(versioned(ctx, '1.18', boolean), false),
112
- sampling: record({
113
- xz_scale: floatRange(0.001, 1000),
114
- y_scale: floatRange(0.001, 1000),
115
- xz_factor: floatRange(0.001, 1000),
116
- y_factor: floatRange(0.001, 1000),
117
- }),
118
- top_slide: noise_slide_settings,
119
- bottom_slide: noise_slide_settings,
120
- terrain_shaper: versioned(ctx, '1.18', record({
121
- offset: terrain_spline,
122
- factor: terrain_spline,
123
- jaggedness: terrain_spline,
124
- })),
125
- }),
126
- surface_rule: versioned(ctx, '1.18', material_rule),
127
- structures: structure_settings,
128
- })));
129
- const climate_parameter = any([floatRange(-2, 2), listOf(floatRange(-2, 2))]);
130
- const biome_source = as('biome_source', dispatch('type', (type, _, ctx) => record({
131
- type: resource('worldgen/biome_source'),
132
- ...pick(type, {
133
- checkerboard: {
134
- scale: opt(intRange(0, 62), 2),
135
- biomes: listOf(resource('worldgen/biome')),
136
- },
137
- fixed: {
138
- biome: resource('worldgen/biome'),
139
- },
140
- multi_noise: {
141
- seed: versioned(ctx, int, '1.18'),
142
- preset: opt(versioned(ctx, literal(['nether']), '1.18', resource(['minecraft:overworld', 'minecraft:nether']))),
143
- ...versioned(ctx, {
144
- altitude_noise: noise_parameters,
145
- temperature_noise: noise_parameters,
146
- humidity_noise: noise_parameters,
147
- weirdness_noise: noise_parameters,
148
- }, '1.18'),
149
- biomes: listOf(record({
150
- biome: resource('worldgen/biome'),
151
- parameters: record(versioned(ctx, {
152
- altitude: float,
153
- temperature: float,
154
- humidity: float,
155
- weirdness: float,
156
- offset: float,
157
- }, '1.18', {
158
- temperature: climate_parameter,
159
- humidity: climate_parameter,
160
- continentalness: climate_parameter,
161
- erosion: climate_parameter,
162
- weirdness: climate_parameter,
163
- depth: climate_parameter,
164
- offset: floatRange(0, 1),
165
- })),
166
- })),
167
- },
168
- the_end: {
169
- seed: int,
170
- },
171
- vanilla_layered: {
172
- seed: int,
173
- large_biomes: opt(boolean, false),
174
- legacy_biome_init_layer: opt(boolean, false),
175
- },
176
- }),
177
- })));
178
- export const dimension_type = as('dimension_type', dispatch((_, ctx) => record({
179
- min_y: versioned(ctx, '1.17', intRange(-2048, 2047)),
180
- height: versioned(ctx, '1.17', intRange(0, 4096)),
181
- logical_height: versioned(ctx, intRange(0, 256), '1.17', intRange(0, 4096)),
182
- coordinate_scale: floatRange(0.00001, 30000000),
183
- ambient_light: float,
184
- fixed_time: opt(int),
185
- infiniburn: resource('tag/block'),
186
- effects: opt(resource(['overworld', 'the_nether', 'the_end']), 'overworld'),
187
- ultrawarm: boolean,
188
- natural: boolean,
189
- piglin_safe: boolean,
190
- respawn_anchor_works: boolean,
191
- bed_works: boolean,
192
- has_raids: boolean,
193
- has_skylight: boolean,
194
- has_ceiling: boolean,
195
- })));
196
- export const dimension = as('dimension', record({
197
- type: any([resource('dimension_type'), dimension_type]),
198
- generator: as('chunk_generator', dispatch('type', (type) => record({
199
- type: resource('worldgen/chunk_generator'),
200
- ...pick(type, {
201
- flat: {
202
- settings: record({
203
- layers: listOf(record({
204
- block: resource('block'),
205
- height: intRange(0, 4096),
206
- })),
207
- biome: resource('worldgen/biome'),
208
- lakes: opt(boolean, false),
209
- features: opt(boolean, false),
210
- structures: structure_settings,
211
- }),
212
- },
213
- noise: {
214
- seed: int,
215
- settings: any([
216
- resource('worldgen/noise_settings'),
217
- noise_settings,
218
- ]),
219
- biome_source: biome_source,
220
- },
221
- }),
222
- }))),
223
- }));
224
- //# sourceMappingURL=dimension.js.map
@@ -1,9 +0,0 @@
1
- export declare const configured_decorator: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
2
- export declare const placement_modifier: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
3
- export declare const configured_feature: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
4
- export declare const configured_feature_ref: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
5
- export declare const configured_feature_list_ref: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
6
- export declare const placed_feature: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
7
- export declare const placed_feature_ref: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
8
- export declare const placed_feature_list_ref: import("@spyglassmc/json/lib/checker/JsonChecker.js").JsonChecker;
9
- //# sourceMappingURL=feature.d.ts.map