@spyglassmc/java-edition 0.1.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/binder/index.d.ts +1 -1
- package/lib/binder/index.js +11 -17
- package/lib/common/index.js +6 -33
- package/lib/dependency/common.js +6 -9
- package/lib/dependency/index.d.ts +6 -6
- package/lib/dependency/index.js +18 -49
- package/lib/dependency/mcmeta.d.ts +2 -2
- package/lib/dependency/mcmeta.js +8 -37
- package/lib/index.d.ts +3 -3
- package/lib/index.js +21 -48
- package/lib/json/checker/data/advancement.d.ts +13 -13
- package/lib/json/checker/data/advancement.js +263 -266
- package/lib/json/checker/data/biome.d.ts +3 -3
- package/lib/json/checker/data/biome.js +98 -101
- package/lib/json/checker/data/common.d.ts +1 -1
- package/lib/json/checker/data/common.js +145 -152
- package/lib/json/checker/data/dimension.d.ts +3 -3
- package/lib/json/checker/data/dimension.js +148 -151
- package/lib/json/checker/data/feature.d.ts +8 -8
- package/lib/json/checker/data/feature.js +370 -373
- package/lib/json/checker/data/index.d.ts +2 -2
- package/lib/json/checker/data/index.js +36 -39
- package/lib/json/checker/data/loot_table.d.ts +7 -7
- package/lib/json/checker/data/loot_table.js +125 -128
- package/lib/json/checker/data/recipe.d.ts +1 -1
- package/lib/json/checker/data/recipe.js +25 -28
- package/lib/json/checker/data/structure.d.ts +7 -7
- package/lib/json/checker/data/structure.js +80 -83
- package/lib/json/checker/data/tag.d.ts +6 -6
- package/lib/json/checker/data/tag.js +23 -26
- package/lib/json/checker/data/text_component.d.ts +1 -1
- package/lib/json/checker/data/text_component.js +61 -64
- package/lib/json/checker/index.js +14 -19
- package/lib/json/checker/util/advancement.d.ts +1 -1
- package/lib/json/checker/util/advancement.js +6 -10
- package/lib/json/checker/util/block_states.d.ts +1 -1
- package/lib/json/checker/util/block_states.js +25 -53
- package/lib/json/checker/util/color.d.ts +1 -1
- package/lib/json/checker/util/color.js +24 -29
- package/lib/json/checker/util/index.d.ts +7 -7
- package/lib/json/checker/util/index.js +7 -23
- package/lib/json/checker/util/nbt.d.ts +1 -1
- package/lib/json/checker/util/nbt.js +23 -28
- package/lib/json/checker/util/recipe.d.ts +1 -1
- package/lib/json/checker/util/recipe.js +4 -8
- package/lib/json/checker/util/uuid.d.ts +1 -1
- package/lib/json/checker/util/uuid.js +4 -7
- package/lib/json/checker/util/version.d.ts +2 -2
- package/lib/json/checker/util/version.js +7 -13
- package/lib/json/index.d.ts +1 -1
- package/lib/json/index.js +4 -31
- package/lib/mcfunction/checker/index.d.ts +1 -1
- package/lib/mcfunction/checker/index.js +24 -53
- package/lib/mcfunction/colorizer/index.d.ts +1 -1
- package/lib/mcfunction/colorizer/index.js +6 -35
- package/lib/mcfunction/common/index.js +7 -33
- package/lib/mcfunction/completer/argument.js +93 -120
- package/lib/mcfunction/completer/index.d.ts +1 -1
- package/lib/mcfunction/completer/index.js +1 -17
- package/lib/mcfunction/index.d.ts +5 -5
- package/lib/mcfunction/index.js +16 -43
- package/lib/mcfunction/inlayHintProvider.js +3 -30
- package/lib/mcfunction/node/argument.d.ts +7 -7
- package/lib/mcfunction/node/argument.js +38 -63
- package/lib/mcfunction/node/index.d.ts +1 -1
- package/lib/mcfunction/node/index.js +1 -17
- package/lib/mcfunction/parser/argument.d.ts +1 -1
- package/lib/mcfunction/parser/argument.js +72 -100
- package/lib/mcfunction/parser/index.d.ts +1 -1
- package/lib/mcfunction/parser/index.js +1 -17
- package/lib/mcfunction/signatureHelpProvider.js +3 -30
- package/lib/mcfunction/tree/argument.js +1 -2
- package/lib/mcfunction/tree/index.d.ts +1 -1
- package/lib/mcfunction/tree/index.js +1 -17
- package/lib/mcfunction/tree/patch.d.ts +1 -1
- package/lib/mcfunction/tree/patch.js +5 -9
- package/package.json +8 -7
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.Direction = exports.Slots = exports.HeightmapType = exports.noise_parameters = exports.inclusiveRange = exports.uniformInt = exports.intProvider = exports.floatProvider = exports.height_provider = exports.vertical_anchor = exports.fluid_state = exports.block_state = exports.float_bounds = exports.int_bounds = exports.nbt_provider = exports.score_provider = exports.number_provider = exports.MIN_Y = exports.MAX_Y = exports.Y_SIZE = void 0;
|
|
4
|
-
const primitives_1 = require("@spyglassmc/json/lib/checker/primitives");
|
|
5
|
-
const util_1 = require("../util");
|
|
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';
|
|
6
3
|
function smallestEncompassingPowerOfTwo(n) {
|
|
7
4
|
n = n - 1;
|
|
8
5
|
n |= n >> 1;
|
|
@@ -13,253 +10,249 @@ function smallestEncompassingPowerOfTwo(n) {
|
|
|
13
10
|
return n + 1;
|
|
14
11
|
}
|
|
15
12
|
const BITS_FOR_Y = 64 - 2 * (1 + Math.log2(smallestEncompassingPowerOfTwo(30000000))); // 12
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
type:
|
|
13
|
+
export const Y_SIZE = (1 << BITS_FOR_Y) - 32; // 4064
|
|
14
|
+
export const MAX_Y = (Y_SIZE >> 1) - 1; // 2031
|
|
15
|
+
export const MIN_Y = MAX_Y - Y_SIZE + 1; // -2031
|
|
16
|
+
export const number_provider = as('range', any([
|
|
17
|
+
float,
|
|
18
|
+
dispatch('type', (type) => record({
|
|
19
|
+
type: opt(resource('loot_number_provider_type')),
|
|
23
20
|
...type === undefined ? {
|
|
24
|
-
min:
|
|
25
|
-
max:
|
|
21
|
+
min: number_provider,
|
|
22
|
+
max: number_provider,
|
|
26
23
|
} : {},
|
|
27
|
-
...
|
|
24
|
+
...pick(type, {
|
|
28
25
|
constant: {
|
|
29
|
-
value:
|
|
26
|
+
value: float,
|
|
30
27
|
},
|
|
31
28
|
uniform: {
|
|
32
|
-
min:
|
|
33
|
-
max:
|
|
29
|
+
min: number_provider,
|
|
30
|
+
max: number_provider,
|
|
34
31
|
},
|
|
35
32
|
binomial: {
|
|
36
|
-
n:
|
|
37
|
-
p:
|
|
33
|
+
n: number_provider,
|
|
34
|
+
p: number_provider,
|
|
38
35
|
},
|
|
39
36
|
score: {
|
|
40
|
-
target:
|
|
41
|
-
score:
|
|
42
|
-
scale:
|
|
37
|
+
target: score_provider,
|
|
38
|
+
score: literal('objective'),
|
|
39
|
+
scale: opt(float),
|
|
43
40
|
},
|
|
44
41
|
}),
|
|
45
42
|
})),
|
|
46
43
|
]));
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
type:
|
|
51
|
-
...
|
|
44
|
+
export const score_provider = any([
|
|
45
|
+
literal(['this', 'killer', 'player_killer', 'direct_killer']),
|
|
46
|
+
dispatch('type', (type) => record({
|
|
47
|
+
type: resource('loot_score_provider_type'),
|
|
48
|
+
...pick(type, {
|
|
52
49
|
context: {
|
|
53
|
-
target:
|
|
50
|
+
target: literal(['this', 'killer', 'player_killer', 'direct_killer']),
|
|
54
51
|
},
|
|
55
52
|
fixed: {
|
|
56
|
-
name:
|
|
53
|
+
name: simpleString, // TODO: score holder, no selector
|
|
57
54
|
},
|
|
58
55
|
}),
|
|
59
56
|
})),
|
|
60
57
|
]);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
type:
|
|
65
|
-
...
|
|
58
|
+
export const nbt_provider = any([
|
|
59
|
+
literal(['this', 'killer', 'killer_player', 'block_entity']),
|
|
60
|
+
dispatch('type', type => record({
|
|
61
|
+
type: resource('loot_nbt_provider_type'),
|
|
62
|
+
...pick(type, {
|
|
66
63
|
context: {
|
|
67
|
-
target:
|
|
64
|
+
target: literal(['this', 'killer', 'killer_player', 'block_entity']),
|
|
68
65
|
},
|
|
69
66
|
storage: {
|
|
70
|
-
source:
|
|
67
|
+
source: resource('storage'),
|
|
71
68
|
},
|
|
72
69
|
}),
|
|
73
70
|
})),
|
|
74
71
|
]);
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
min:
|
|
80
|
-
max:
|
|
72
|
+
export const int_bounds = as('bounds', any([
|
|
73
|
+
int,
|
|
74
|
+
any([
|
|
75
|
+
record({
|
|
76
|
+
min: int,
|
|
77
|
+
max: opt(int),
|
|
81
78
|
}),
|
|
82
|
-
|
|
83
|
-
min:
|
|
84
|
-
max:
|
|
79
|
+
record({
|
|
80
|
+
min: opt(int),
|
|
81
|
+
max: int,
|
|
85
82
|
}),
|
|
86
83
|
]),
|
|
87
84
|
]));
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
min:
|
|
93
|
-
max:
|
|
85
|
+
export const float_bounds = as('bounds', any([
|
|
86
|
+
float,
|
|
87
|
+
any([
|
|
88
|
+
record({
|
|
89
|
+
min: float,
|
|
90
|
+
max: opt(float),
|
|
94
91
|
}),
|
|
95
|
-
|
|
96
|
-
min:
|
|
97
|
-
max:
|
|
92
|
+
record({
|
|
93
|
+
min: opt(float),
|
|
94
|
+
max: float,
|
|
98
95
|
}),
|
|
99
96
|
]),
|
|
100
97
|
]));
|
|
101
|
-
|
|
102
|
-
Name:
|
|
103
|
-
Properties:
|
|
104
|
-
id:
|
|
98
|
+
export const block_state = as('block_state', dispatch(props => record({
|
|
99
|
+
Name: resource('block'),
|
|
100
|
+
Properties: opt(blockStateMap({
|
|
101
|
+
id: extract('Name', props),
|
|
105
102
|
requireAll: true,
|
|
106
103
|
})),
|
|
107
104
|
})));
|
|
108
|
-
|
|
109
|
-
Name:
|
|
110
|
-
Properties:
|
|
111
|
-
id:
|
|
105
|
+
export const fluid_state = as('fluid_state', dispatch(props => record({
|
|
106
|
+
Name: resource('fluid'),
|
|
107
|
+
Properties: opt(blockStateMap({
|
|
108
|
+
id: extract('Name', props),
|
|
112
109
|
category: 'fluid',
|
|
113
110
|
requireAll: true,
|
|
114
111
|
})),
|
|
115
112
|
})));
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
absolute:
|
|
113
|
+
export const vertical_anchor = as('vertical_anchor', any([
|
|
114
|
+
record({
|
|
115
|
+
absolute: intRange(MIN_Y, MAX_Y),
|
|
119
116
|
}),
|
|
120
|
-
|
|
121
|
-
above_bottom:
|
|
117
|
+
record({
|
|
118
|
+
above_bottom: intRange(MIN_Y, MAX_Y),
|
|
122
119
|
}),
|
|
123
|
-
|
|
124
|
-
below_top:
|
|
120
|
+
record({
|
|
121
|
+
below_top: intRange(MIN_Y, MAX_Y),
|
|
125
122
|
}),
|
|
126
123
|
]));
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
type:
|
|
131
|
-
...
|
|
124
|
+
export const height_provider = as('height_provider', any([
|
|
125
|
+
vertical_anchor,
|
|
126
|
+
dispatch('type', type => record({
|
|
127
|
+
type: resource('height_provider_type'),
|
|
128
|
+
...pick(type, {
|
|
132
129
|
constant: {
|
|
133
|
-
value:
|
|
130
|
+
value: vertical_anchor,
|
|
134
131
|
},
|
|
135
132
|
uniform: {
|
|
136
|
-
min_inclusive:
|
|
137
|
-
max_inclusive:
|
|
133
|
+
min_inclusive: vertical_anchor,
|
|
134
|
+
max_inclusive: vertical_anchor,
|
|
138
135
|
},
|
|
139
136
|
biased_to_bottom: {
|
|
140
|
-
min_inclusive:
|
|
141
|
-
max_inclusive:
|
|
142
|
-
inner:
|
|
137
|
+
min_inclusive: vertical_anchor,
|
|
138
|
+
max_inclusive: vertical_anchor,
|
|
139
|
+
inner: opt(intRange(1, undefined), 1),
|
|
143
140
|
},
|
|
144
141
|
very_biased_to_bottom: {
|
|
145
|
-
min_inclusive:
|
|
146
|
-
max_inclusive:
|
|
147
|
-
inner:
|
|
142
|
+
min_inclusive: vertical_anchor,
|
|
143
|
+
max_inclusive: vertical_anchor,
|
|
144
|
+
inner: opt(intRange(1, undefined), 1),
|
|
148
145
|
},
|
|
149
146
|
trapezoid: {
|
|
150
|
-
min_inclusive:
|
|
151
|
-
max_inclusive:
|
|
152
|
-
plateau:
|
|
147
|
+
min_inclusive: vertical_anchor,
|
|
148
|
+
max_inclusive: vertical_anchor,
|
|
149
|
+
plateau: opt(int, 0),
|
|
153
150
|
},
|
|
154
151
|
weighted_list: {
|
|
155
|
-
distribution:
|
|
156
|
-
data:
|
|
157
|
-
weight:
|
|
152
|
+
distribution: listOf(record({
|
|
153
|
+
data: ref(() => height_provider),
|
|
154
|
+
weight: int,
|
|
158
155
|
})),
|
|
159
156
|
},
|
|
160
157
|
}),
|
|
161
158
|
})),
|
|
162
159
|
]));
|
|
163
|
-
const floatProvider = (min = undefined, max = undefined) =>
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
type:
|
|
167
|
-
...
|
|
160
|
+
export const floatProvider = (min = undefined, max = undefined) => as('float_provider', any([
|
|
161
|
+
floatRange(min, max),
|
|
162
|
+
dispatch('type', type => record({
|
|
163
|
+
type: resource('float_provider_type'),
|
|
164
|
+
...pick(type, {
|
|
168
165
|
constant: {
|
|
169
|
-
value:
|
|
166
|
+
value: floatRange(min, max),
|
|
170
167
|
},
|
|
171
168
|
uniform: {
|
|
172
|
-
value:
|
|
173
|
-
min_inclusive:
|
|
174
|
-
max_exclusive:
|
|
169
|
+
value: record({
|
|
170
|
+
min_inclusive: floatRange(min, max),
|
|
171
|
+
max_exclusive: floatRange(min, max),
|
|
175
172
|
}),
|
|
176
173
|
},
|
|
177
174
|
clamped_normal: {
|
|
178
|
-
value:
|
|
179
|
-
mean:
|
|
180
|
-
deviation:
|
|
181
|
-
min:
|
|
182
|
-
max:
|
|
175
|
+
value: record({
|
|
176
|
+
mean: float,
|
|
177
|
+
deviation: float,
|
|
178
|
+
min: floatRange(min, max),
|
|
179
|
+
max: floatRange(min, max),
|
|
183
180
|
}),
|
|
184
181
|
},
|
|
185
182
|
trapezoid: {
|
|
186
|
-
value:
|
|
187
|
-
min:
|
|
188
|
-
max:
|
|
189
|
-
plateau:
|
|
183
|
+
value: record({
|
|
184
|
+
min: floatRange(min, max),
|
|
185
|
+
max: floatRange(min, max),
|
|
186
|
+
plateau: float,
|
|
190
187
|
}),
|
|
191
188
|
},
|
|
192
189
|
}),
|
|
193
190
|
})),
|
|
194
191
|
]));
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
(
|
|
198
|
-
|
|
199
|
-
type
|
|
200
|
-
...(0, primitives_1.pick)(type, {
|
|
192
|
+
export const intProvider = (min = undefined, max = undefined) => as('int_provider', any([
|
|
193
|
+
intRange(min, max),
|
|
194
|
+
dispatch('type', type => record({
|
|
195
|
+
type: resource('int_provider_type'),
|
|
196
|
+
...pick(type, {
|
|
201
197
|
constant: {
|
|
202
|
-
value:
|
|
198
|
+
value: intRange(min, max),
|
|
203
199
|
},
|
|
204
200
|
uniform: {
|
|
205
|
-
value:
|
|
206
|
-
min_inclusive:
|
|
207
|
-
max_inclusive:
|
|
201
|
+
value: record({
|
|
202
|
+
min_inclusive: intRange(min, max),
|
|
203
|
+
max_inclusive: intRange(min, max),
|
|
208
204
|
}),
|
|
209
205
|
},
|
|
210
206
|
biased_to_bottom: {
|
|
211
|
-
value:
|
|
212
|
-
min_inclusive:
|
|
213
|
-
max_inclusive:
|
|
207
|
+
value: record({
|
|
208
|
+
min_inclusive: intRange(min, max),
|
|
209
|
+
max_inclusive: intRange(min, max),
|
|
214
210
|
}),
|
|
215
211
|
},
|
|
216
212
|
clamped: {
|
|
217
|
-
value:
|
|
218
|
-
min_inclusive:
|
|
219
|
-
max_inclusive:
|
|
220
|
-
source:
|
|
213
|
+
value: record({
|
|
214
|
+
min_inclusive: intRange(min, max),
|
|
215
|
+
max_inclusive: intRange(min, max),
|
|
216
|
+
source: ref(() => intProvider()),
|
|
221
217
|
}),
|
|
222
218
|
},
|
|
223
219
|
clamped_normal: {
|
|
224
|
-
value:
|
|
225
|
-
mean:
|
|
226
|
-
deviation:
|
|
227
|
-
min_inclusive:
|
|
228
|
-
max_inclusive:
|
|
220
|
+
value: record({
|
|
221
|
+
mean: float,
|
|
222
|
+
deviation: float,
|
|
223
|
+
min_inclusive: intRange(min, max),
|
|
224
|
+
max_inclusive: intRange(min, max),
|
|
229
225
|
}),
|
|
230
226
|
},
|
|
231
227
|
weighted_list: {
|
|
232
|
-
distribution:
|
|
233
|
-
data:
|
|
234
|
-
weight:
|
|
228
|
+
distribution: listOf(record({
|
|
229
|
+
data: ref(() => intProvider()),
|
|
230
|
+
weight: int,
|
|
235
231
|
})),
|
|
236
232
|
},
|
|
237
233
|
}),
|
|
238
234
|
})),
|
|
239
235
|
]));
|
|
240
|
-
exports.intProvider = intProvider;
|
|
241
236
|
// until 1.16
|
|
242
|
-
const uniformInt = (min, max, maxSpread) =>
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
base:
|
|
246
|
-
spread:
|
|
237
|
+
export const uniformInt = (min, max, maxSpread) => as('uniform_int', any([
|
|
238
|
+
intRange(min, max),
|
|
239
|
+
record({
|
|
240
|
+
base: intRange(min, max),
|
|
241
|
+
spread: intRange(0, maxSpread),
|
|
247
242
|
}),
|
|
248
243
|
]));
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
max_inclusive: (0, primitives_1.intRange)(min, max),
|
|
244
|
+
export const inclusiveRange = (min, max) => as('inclusive_range', any([
|
|
245
|
+
record({
|
|
246
|
+
min_inclusive: intRange(min, max),
|
|
247
|
+
max_inclusive: intRange(min, max),
|
|
254
248
|
}),
|
|
255
|
-
|
|
249
|
+
listOf(intRange(min, max)),
|
|
256
250
|
]));
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
amplitudes: (0, primitives_1.listOf)(primitives_1.float),
|
|
251
|
+
export const noise_parameters = record({
|
|
252
|
+
firstOctave: int,
|
|
253
|
+
amplitudes: listOf(float),
|
|
261
254
|
});
|
|
262
|
-
|
|
255
|
+
export const HeightmapType = [
|
|
263
256
|
'MOTION_BLOCKING',
|
|
264
257
|
'MOTION_BLOCKING_NO_LEAVES',
|
|
265
258
|
'OCEAN_FLOOR',
|
|
@@ -267,7 +260,7 @@ exports.HeightmapType = [
|
|
|
267
260
|
'WORLD_SURFACE',
|
|
268
261
|
'WORLD_SURFACE_WG',
|
|
269
262
|
];
|
|
270
|
-
|
|
263
|
+
export const Slots = [
|
|
271
264
|
'mainhand',
|
|
272
265
|
'offhand',
|
|
273
266
|
'head',
|
|
@@ -275,7 +268,7 @@ exports.Slots = [
|
|
|
275
268
|
'legs',
|
|
276
269
|
'feet',
|
|
277
270
|
];
|
|
278
|
-
|
|
271
|
+
export const Direction = [
|
|
279
272
|
'up',
|
|
280
273
|
'down',
|
|
281
274
|
'north',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const noise_settings: import("@spyglassmc/json/lib/checker").JsonChecker;
|
|
2
|
-
export declare const dimension_type: import("@spyglassmc/json/lib/checker").JsonChecker;
|
|
3
|
-
export declare const dimension: import("@spyglassmc/json/lib/checker").JsonChecker;
|
|
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
4
|
//# sourceMappingURL=dimension.d.ts.map
|