@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,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const util_1 = require("../util");
|
|
7
|
-
const common_1 = require("./common");
|
|
8
|
-
const structure_1 = require("./structure");
|
|
1
|
+
import { JsonArrayNode, JsonObjectNode } from '@spyglassmc/json';
|
|
2
|
+
import { any, as, boolean, dispatch, extract, float, floatRange, int, intRange, listOf, literal, opt, pick, record, ref, resource, simpleString } from '@spyglassmc/json/lib/checker/primitives/index.js';
|
|
3
|
+
import { renamed, versioned } from '../util/index.js';
|
|
4
|
+
import { block_state, Direction, floatProvider, fluid_state, HeightmapType, height_provider, inclusiveRange, intProvider, noise_parameters, uniformInt, Y_SIZE } from './common.js';
|
|
5
|
+
import { processor_list_ref, rule_test } from './structure.js';
|
|
9
6
|
function intersection(...values) {
|
|
10
7
|
return [...new Set([].concat(...values).filter(e => values.every(a => a.includes(e))))];
|
|
11
8
|
}
|
|
12
9
|
function blockStateIntProperties(node, ctx) {
|
|
13
|
-
if (node &&
|
|
14
|
-
let block =
|
|
10
|
+
if (node && JsonObjectNode.is(node)) {
|
|
11
|
+
let block = extract('Name', node.children);
|
|
15
12
|
if (block) {
|
|
16
13
|
if (!block.startsWith('minecraft:')) {
|
|
17
14
|
block = `minecraft:${block}`;
|
|
@@ -22,7 +19,7 @@ function blockStateIntProperties(node, ctx) {
|
|
|
22
19
|
.map(m => m.identifier);
|
|
23
20
|
}
|
|
24
21
|
}
|
|
25
|
-
else if (node &&
|
|
22
|
+
else if (node && JsonArrayNode.is(node)) {
|
|
26
23
|
const values = node.children.map(item => item.value)
|
|
27
24
|
.filter(n => n)
|
|
28
25
|
.map(n => blockStateIntProperties(n, ctx));
|
|
@@ -31,9 +28,9 @@ function blockStateIntProperties(node, ctx) {
|
|
|
31
28
|
return [];
|
|
32
29
|
}
|
|
33
30
|
function blockProviderProperties(node, ctx) {
|
|
34
|
-
if (!node || !
|
|
31
|
+
if (!node || !JsonObjectNode.is(node))
|
|
35
32
|
return [];
|
|
36
|
-
switch (
|
|
33
|
+
switch (extract('type', node.children)?.replace(/^minecraft:/, '')) {
|
|
37
34
|
case 'dual_noise_provider':
|
|
38
35
|
case 'noise_provider':
|
|
39
36
|
const states = node.children.find(p => p.key?.value === 'states')?.value;
|
|
@@ -51,9 +48,9 @@ function blockProviderProperties(node, ctx) {
|
|
|
51
48
|
return blockStateIntProperties(state, ctx);
|
|
52
49
|
case 'weighted_state_provider':
|
|
53
50
|
const entries = node.children.find(p => p.key?.value === 'entries')?.value;
|
|
54
|
-
if (entries &&
|
|
51
|
+
if (entries && JsonArrayNode.is(entries)) {
|
|
55
52
|
const values = entries.children
|
|
56
|
-
.map(n => n.value &&
|
|
53
|
+
.map(n => n.value && JsonObjectNode.is(n.value) &&
|
|
57
54
|
n.value.children.find(p => p.key?.value === 'data')?.value)
|
|
58
55
|
.filter(n => n)
|
|
59
56
|
.map(n => blockStateIntProperties(n, ctx));
|
|
@@ -63,390 +60,390 @@ function blockProviderProperties(node, ctx) {
|
|
|
63
60
|
return [];
|
|
64
61
|
}
|
|
65
62
|
const noiseProvider = {
|
|
66
|
-
seed:
|
|
67
|
-
noise:
|
|
68
|
-
scale:
|
|
63
|
+
seed: int,
|
|
64
|
+
noise: noise_parameters,
|
|
65
|
+
scale: floatRange(0, undefined), // TODO: disallow 0
|
|
69
66
|
};
|
|
70
|
-
const block_state_provider =
|
|
71
|
-
type:
|
|
72
|
-
...
|
|
67
|
+
const block_state_provider = as('block_state_provider', dispatch('type', (type, props, ctx) => record({
|
|
68
|
+
type: resource('worldgen/block_state_provider_type'),
|
|
69
|
+
...pick(type, {
|
|
73
70
|
dual_noise_provider: {
|
|
74
71
|
...noiseProvider,
|
|
75
|
-
variety:
|
|
76
|
-
slow_noise:
|
|
77
|
-
slow_scale:
|
|
78
|
-
states:
|
|
72
|
+
variety: inclusiveRange(1, 64),
|
|
73
|
+
slow_noise: noise_parameters,
|
|
74
|
+
slow_scale: floatRange(0, undefined),
|
|
75
|
+
states: listOf(block_state),
|
|
79
76
|
},
|
|
80
77
|
noise_threshold_provider: {
|
|
81
78
|
...noiseProvider,
|
|
82
|
-
threshold:
|
|
83
|
-
high_chance:
|
|
84
|
-
default_state:
|
|
85
|
-
low_states:
|
|
86
|
-
high_states:
|
|
79
|
+
threshold: floatRange(-1, 1),
|
|
80
|
+
high_chance: floatRange(0, 1),
|
|
81
|
+
default_state: block_state,
|
|
82
|
+
low_states: listOf(block_state),
|
|
83
|
+
high_states: listOf(block_state),
|
|
87
84
|
},
|
|
88
85
|
noise_provider: {
|
|
89
86
|
...noiseProvider,
|
|
90
|
-
states:
|
|
87
|
+
states: listOf(block_state),
|
|
91
88
|
},
|
|
92
89
|
randomized_int_state_provider: {
|
|
93
|
-
// FIXME: Temporary solution to make tests pass when
|
|
94
|
-
property: (ctx.
|
|
95
|
-
values:
|
|
90
|
+
// FIXME: Temporary solution to make tests pass when ensureBindingStarted is not given.
|
|
91
|
+
property: (ctx.ensureBindingStarted) ? literal(blockProviderProperties(props.find(p => p.key?.value === 'source')?.value, ctx)) : simpleString,
|
|
92
|
+
values: intProvider(),
|
|
96
93
|
source: block_state_provider,
|
|
97
94
|
},
|
|
98
95
|
rotated_block_provider: {
|
|
99
|
-
state:
|
|
96
|
+
state: block_state,
|
|
100
97
|
},
|
|
101
98
|
simple_state_provider: {
|
|
102
|
-
state:
|
|
99
|
+
state: block_state,
|
|
103
100
|
},
|
|
104
101
|
weighted_state_provider: {
|
|
105
|
-
entries:
|
|
106
|
-
weight:
|
|
107
|
-
data:
|
|
102
|
+
entries: listOf(record({
|
|
103
|
+
weight: intRange(1, undefined),
|
|
104
|
+
data: block_state,
|
|
108
105
|
})),
|
|
109
106
|
},
|
|
110
107
|
}),
|
|
111
108
|
})));
|
|
112
109
|
const blockPredicateOffset = {
|
|
113
|
-
offset:
|
|
110
|
+
offset: opt(listOf(intRange(-16, 16))),
|
|
114
111
|
};
|
|
115
|
-
const block_predicate_worldgen =
|
|
116
|
-
type:
|
|
117
|
-
...
|
|
112
|
+
const block_predicate_worldgen = as('block_predicate_worldgen', dispatch('type', type => record({
|
|
113
|
+
type: resource('block_predicate_type'),
|
|
114
|
+
...pick(type, {
|
|
118
115
|
all_of: {
|
|
119
|
-
predicates:
|
|
116
|
+
predicates: listOf(block_predicate_worldgen),
|
|
120
117
|
},
|
|
121
118
|
any_of: {
|
|
122
|
-
predicates:
|
|
119
|
+
predicates: listOf(block_predicate_worldgen),
|
|
123
120
|
},
|
|
124
121
|
has_sturdy_face: {
|
|
125
122
|
...blockPredicateOffset,
|
|
126
|
-
direction:
|
|
123
|
+
direction: literal(Direction),
|
|
127
124
|
},
|
|
128
125
|
inside_world_bounds: {
|
|
129
126
|
...blockPredicateOffset,
|
|
130
127
|
},
|
|
131
128
|
matching_block_tag: {
|
|
132
129
|
...blockPredicateOffset,
|
|
133
|
-
tag:
|
|
130
|
+
tag: resource('tag/block'),
|
|
134
131
|
},
|
|
135
132
|
matching_blocks: {
|
|
136
133
|
...blockPredicateOffset,
|
|
137
|
-
blocks:
|
|
134
|
+
blocks: listOf(resource('block')),
|
|
138
135
|
},
|
|
139
136
|
matching_fluids: {
|
|
140
137
|
...blockPredicateOffset,
|
|
141
|
-
fluids:
|
|
138
|
+
fluids: listOf(resource('fluid')),
|
|
142
139
|
},
|
|
143
140
|
not: {
|
|
144
141
|
predicate: block_predicate_worldgen,
|
|
145
142
|
},
|
|
146
143
|
would_survive: {
|
|
147
144
|
...blockPredicateOffset,
|
|
148
|
-
state:
|
|
145
|
+
state: block_state,
|
|
149
146
|
},
|
|
150
147
|
}),
|
|
151
148
|
})));
|
|
152
|
-
const block_placer =
|
|
153
|
-
type:
|
|
154
|
-
...
|
|
149
|
+
const block_placer = as('block_placer', dispatch('type', (type, _, ctx) => record({
|
|
150
|
+
type: resource('worldgen/block_placer_type'),
|
|
151
|
+
...pick(type, {
|
|
155
152
|
column_placer: {
|
|
156
|
-
...
|
|
157
|
-
min_size:
|
|
158
|
-
extra_size:
|
|
153
|
+
...versioned(ctx, {
|
|
154
|
+
min_size: int,
|
|
155
|
+
extra_size: int,
|
|
159
156
|
}, '1.17', {
|
|
160
|
-
size:
|
|
157
|
+
size: intProvider(0, undefined),
|
|
161
158
|
}),
|
|
162
159
|
},
|
|
163
160
|
}),
|
|
164
161
|
})));
|
|
165
|
-
const feature_size =
|
|
166
|
-
type:
|
|
167
|
-
min_clipped_height:
|
|
168
|
-
...
|
|
162
|
+
const feature_size = as('feature_size', dispatch('type', type => record({
|
|
163
|
+
type: resource('worldgen/feature_size_type'),
|
|
164
|
+
min_clipped_height: opt(intRange(0, 80)),
|
|
165
|
+
...pick(type, {
|
|
169
166
|
two_layers_feature_size: {
|
|
170
|
-
limit:
|
|
171
|
-
lower_size:
|
|
172
|
-
upper_size:
|
|
167
|
+
limit: opt(intRange(0, 81), 1),
|
|
168
|
+
lower_size: opt(intRange(0, 16), 0),
|
|
169
|
+
upper_size: opt(intRange(0, 16), 1),
|
|
173
170
|
},
|
|
174
171
|
three_layers_feature_size: {
|
|
175
|
-
limit:
|
|
176
|
-
upper_limit:
|
|
177
|
-
lower_size:
|
|
178
|
-
middle_size:
|
|
179
|
-
upper_size:
|
|
172
|
+
limit: opt(intRange(0, 81), 1),
|
|
173
|
+
upper_limit: opt(intRange(0, 80), 1),
|
|
174
|
+
lower_size: opt(intRange(0, 16), 0),
|
|
175
|
+
middle_size: opt(intRange(0, 16), 1),
|
|
176
|
+
upper_size: opt(intRange(0, 16), 1),
|
|
180
177
|
},
|
|
181
178
|
}),
|
|
182
179
|
})));
|
|
183
|
-
const trunk_placer =
|
|
184
|
-
type:
|
|
185
|
-
base_height:
|
|
186
|
-
height_rand_a:
|
|
187
|
-
height_rand_b:
|
|
188
|
-
...
|
|
180
|
+
const trunk_placer = as('trunk_placer', dispatch('type', type => record({
|
|
181
|
+
type: resource('worldgen/trunk_placer_type'),
|
|
182
|
+
base_height: intRange(0, 32),
|
|
183
|
+
height_rand_a: intRange(0, 24),
|
|
184
|
+
height_rand_b: intRange(0, 24),
|
|
185
|
+
...pick(type, {
|
|
189
186
|
bending_trunk_placer: {
|
|
190
|
-
bend_length:
|
|
191
|
-
min_height_for_leaves:
|
|
187
|
+
bend_length: intProvider(1, 64),
|
|
188
|
+
min_height_for_leaves: opt(intRange(1, undefined), 1),
|
|
192
189
|
},
|
|
193
190
|
}),
|
|
194
191
|
})));
|
|
195
|
-
const foliage_placer =
|
|
196
|
-
type:
|
|
197
|
-
radius:
|
|
198
|
-
offset:
|
|
199
|
-
...
|
|
192
|
+
const foliage_placer = as('foliage_placer', dispatch('type', (type, _, ctx) => record({
|
|
193
|
+
type: resource('worldgen/foliage_placer_type'),
|
|
194
|
+
radius: versioned(ctx, uniformInt(0, 8, 8), '1.17', intProvider(0, 16)),
|
|
195
|
+
offset: versioned(ctx, uniformInt(0, 8, 8), '1.17', intProvider(0, 16)),
|
|
196
|
+
...pick(type, {
|
|
200
197
|
blob_foliage_placer: {
|
|
201
|
-
height:
|
|
198
|
+
height: intRange(0, 16),
|
|
202
199
|
},
|
|
203
200
|
bush_foliage_placer: {
|
|
204
|
-
height:
|
|
201
|
+
height: intRange(0, 16),
|
|
205
202
|
},
|
|
206
203
|
fancy_foliage_placer: {
|
|
207
|
-
height:
|
|
204
|
+
height: intRange(0, 16),
|
|
208
205
|
},
|
|
209
206
|
jungle_foliage_placer: {
|
|
210
|
-
height:
|
|
207
|
+
height: intRange(0, 16),
|
|
211
208
|
},
|
|
212
209
|
mega_pine_foliage_placer: {
|
|
213
|
-
crown_height:
|
|
210
|
+
crown_height: versioned(ctx, uniformInt(0, 16, 8), '1.17', intProvider(0, 24)),
|
|
214
211
|
},
|
|
215
212
|
pine_foliage_placer: {
|
|
216
|
-
height:
|
|
213
|
+
height: versioned(ctx, uniformInt(0, 16, 8), '1.17', intProvider(0, 24)),
|
|
217
214
|
},
|
|
218
215
|
random_spread_foliage_placer: {
|
|
219
|
-
foliage_height:
|
|
220
|
-
leaf_placement_attempts:
|
|
216
|
+
foliage_height: intProvider(1, 512),
|
|
217
|
+
leaf_placement_attempts: intRange(0, 256),
|
|
221
218
|
},
|
|
222
219
|
spruce_foliage_placer: {
|
|
223
|
-
trunk_height:
|
|
220
|
+
trunk_height: versioned(ctx, uniformInt(0, 16, 8), '1.17', intProvider(0, 24)),
|
|
224
221
|
},
|
|
225
222
|
}),
|
|
226
223
|
})));
|
|
227
|
-
const tree_decorator =
|
|
228
|
-
type:
|
|
229
|
-
...
|
|
224
|
+
const tree_decorator = as('tree_decorator', dispatch('type', type => record({
|
|
225
|
+
type: resource('worldgen/tree_decorator_type'),
|
|
226
|
+
...pick(type, {
|
|
230
227
|
alter_ground: {
|
|
231
228
|
provider: block_state_provider,
|
|
232
229
|
},
|
|
233
230
|
beehive: {
|
|
234
|
-
probability:
|
|
231
|
+
probability: floatRange(0, 1),
|
|
235
232
|
},
|
|
236
233
|
cocoa: {
|
|
237
|
-
probability:
|
|
234
|
+
probability: floatRange(0, 1),
|
|
238
235
|
},
|
|
239
236
|
}),
|
|
240
237
|
})));
|
|
241
238
|
const DiskConfig = (ctx) => ({
|
|
242
|
-
state:
|
|
243
|
-
radius:
|
|
244
|
-
half_height:
|
|
245
|
-
targets:
|
|
239
|
+
state: block_state,
|
|
240
|
+
radius: versioned(ctx, uniformInt(0, 4, 4), '1.17', intProvider(0, 8)),
|
|
241
|
+
half_height: intRange(0, 4),
|
|
242
|
+
targets: listOf(block_state),
|
|
246
243
|
});
|
|
247
|
-
const RandomPatchConfig = (ctx) =>
|
|
244
|
+
const RandomPatchConfig = (ctx) => versioned(ctx, {
|
|
248
245
|
state_provider: block_state_provider,
|
|
249
246
|
block_placer: block_placer,
|
|
250
|
-
whitelist:
|
|
251
|
-
blacklist:
|
|
252
|
-
...
|
|
253
|
-
tries:
|
|
254
|
-
xspread:
|
|
255
|
-
yspread:
|
|
256
|
-
zspread:
|
|
257
|
-
can_replace:
|
|
258
|
-
project:
|
|
259
|
-
need_water:
|
|
247
|
+
whitelist: listOf(block_state),
|
|
248
|
+
blacklist: listOf(block_state),
|
|
249
|
+
...versioned(ctx, {
|
|
250
|
+
tries: int,
|
|
251
|
+
xspread: int,
|
|
252
|
+
yspread: int,
|
|
253
|
+
zspread: int,
|
|
254
|
+
can_replace: boolean,
|
|
255
|
+
project: boolean,
|
|
256
|
+
need_water: boolean,
|
|
260
257
|
}, '1.17', {
|
|
261
|
-
tries:
|
|
262
|
-
xspread:
|
|
263
|
-
yspread:
|
|
264
|
-
zspread:
|
|
265
|
-
can_replace:
|
|
266
|
-
project:
|
|
267
|
-
need_water:
|
|
258
|
+
tries: opt(intRange(1, undefined), 128),
|
|
259
|
+
xspread: opt(intRange(0, undefined), 7),
|
|
260
|
+
yspread: opt(intRange(0, undefined), 3),
|
|
261
|
+
zspread: opt(intRange(0, undefined), 7),
|
|
262
|
+
can_replace: opt(boolean, false),
|
|
263
|
+
project: opt(boolean, true),
|
|
264
|
+
need_water: opt(boolean, false),
|
|
268
265
|
}),
|
|
269
266
|
}, '1.18', {
|
|
270
|
-
tries:
|
|
271
|
-
xz_spread:
|
|
272
|
-
y_spread:
|
|
273
|
-
feature:
|
|
267
|
+
tries: opt(intRange(1, undefined), 128),
|
|
268
|
+
xz_spread: opt(intRange(0, undefined)),
|
|
269
|
+
y_spread: opt(intRange(0, undefined)),
|
|
270
|
+
feature: placed_feature_ref,
|
|
274
271
|
});
|
|
275
272
|
const HugeMushroomConfig = {
|
|
276
|
-
foliage_radius:
|
|
273
|
+
foliage_radius: opt(int, 2),
|
|
277
274
|
cap_provider: block_state_provider,
|
|
278
275
|
stem_provider: block_state_provider,
|
|
279
276
|
};
|
|
280
277
|
const OreConfig = (ctx) => ({
|
|
281
|
-
size:
|
|
282
|
-
...
|
|
283
|
-
state:
|
|
284
|
-
target:
|
|
278
|
+
size: intRange(0, 64),
|
|
279
|
+
...versioned(ctx, {
|
|
280
|
+
state: block_state,
|
|
281
|
+
target: rule_test,
|
|
285
282
|
}, '1.17', {
|
|
286
|
-
discard_chance_on_air_exposure:
|
|
287
|
-
targets:
|
|
288
|
-
state:
|
|
289
|
-
target:
|
|
283
|
+
discard_chance_on_air_exposure: floatRange(0, 1),
|
|
284
|
+
targets: listOf(record({
|
|
285
|
+
state: block_state,
|
|
286
|
+
target: rule_test,
|
|
290
287
|
})),
|
|
291
288
|
}),
|
|
292
289
|
});
|
|
293
290
|
const CountConfig = (ctx) => ({
|
|
294
|
-
count:
|
|
291
|
+
count: versioned(ctx, uniformInt(-10, 128, 128), '1.17', intProvider(0, 256)),
|
|
295
292
|
});
|
|
296
293
|
// until 1.16
|
|
297
294
|
const RangeConfig = {
|
|
298
|
-
maximum:
|
|
299
|
-
bottom_offset:
|
|
300
|
-
top_offset:
|
|
295
|
+
maximum: int,
|
|
296
|
+
bottom_offset: int,
|
|
297
|
+
top_offset: int,
|
|
301
298
|
};
|
|
302
299
|
const VegetationPatchConfig = (ctx) => ({
|
|
303
|
-
surface:
|
|
304
|
-
depth:
|
|
305
|
-
vertical_range:
|
|
306
|
-
extra_bottom_block_chance:
|
|
307
|
-
extra_edge_column_chance:
|
|
308
|
-
vegetation_chance:
|
|
309
|
-
xz_radius:
|
|
310
|
-
replaceable:
|
|
300
|
+
surface: literal(['floor', 'ceiling']),
|
|
301
|
+
depth: intProvider(1, 128),
|
|
302
|
+
vertical_range: intRange(1, 256),
|
|
303
|
+
extra_bottom_block_chance: floatRange(0, 1),
|
|
304
|
+
extra_edge_column_chance: floatRange(0, 1),
|
|
305
|
+
vegetation_chance: floatRange(0, 1),
|
|
306
|
+
xz_radius: intProvider(),
|
|
307
|
+
replaceable: resource('tag/block'),
|
|
311
308
|
ground_state: block_state_provider,
|
|
312
|
-
vegetation_feature:
|
|
309
|
+
vegetation_feature: versioned(ctx, ref(() => configured_feature_ref), '1.18', ref(() => placed_feature_ref)),
|
|
313
310
|
});
|
|
314
311
|
// until 1.17
|
|
315
|
-
|
|
316
|
-
type:
|
|
317
|
-
config:
|
|
312
|
+
export const configured_decorator = as('decorator', dispatch('type', (type, _, ctx) => record({
|
|
313
|
+
type: resource('worldgen/decorator'),
|
|
314
|
+
config: record(pick(type, {
|
|
318
315
|
carving_mask: {
|
|
319
|
-
step:
|
|
320
|
-
probability:
|
|
316
|
+
step: literal(['air', 'liquid']),
|
|
317
|
+
probability: versioned(ctx, floatRange(0, 1), '1.16'),
|
|
321
318
|
},
|
|
322
319
|
cave_surface: {
|
|
323
|
-
surface:
|
|
324
|
-
floor_to_ceiling_search_range:
|
|
320
|
+
surface: literal(['floor', 'ceiling']),
|
|
321
|
+
floor_to_ceiling_search_range: int,
|
|
325
322
|
},
|
|
326
323
|
chance: {
|
|
327
|
-
chance:
|
|
324
|
+
chance: int,
|
|
328
325
|
},
|
|
329
326
|
count: CountConfig(ctx),
|
|
330
327
|
count_extra: {
|
|
331
|
-
count:
|
|
332
|
-
extra_chance:
|
|
333
|
-
extra_count:
|
|
328
|
+
count: int,
|
|
329
|
+
extra_chance: float,
|
|
330
|
+
extra_count: int,
|
|
334
331
|
},
|
|
335
332
|
count_multilayer: CountConfig(ctx),
|
|
336
333
|
count_noise: {
|
|
337
|
-
noise_level:
|
|
338
|
-
below_noise:
|
|
339
|
-
above_noise:
|
|
334
|
+
noise_level: float,
|
|
335
|
+
below_noise: int,
|
|
336
|
+
above_noise: int,
|
|
340
337
|
},
|
|
341
338
|
count_noise_biased: {
|
|
342
|
-
noise_to_count_ratio:
|
|
343
|
-
noise_factor:
|
|
344
|
-
noise_offset:
|
|
339
|
+
noise_to_count_ratio: int,
|
|
340
|
+
noise_factor: float,
|
|
341
|
+
noise_offset: opt(float, 0),
|
|
345
342
|
},
|
|
346
343
|
decorated: {
|
|
347
|
-
outer:
|
|
348
|
-
inner:
|
|
344
|
+
outer: configured_decorator,
|
|
345
|
+
inner: configured_decorator,
|
|
349
346
|
},
|
|
350
347
|
depth_average: {
|
|
351
|
-
baseline:
|
|
352
|
-
spread:
|
|
348
|
+
baseline: int,
|
|
349
|
+
spread: int,
|
|
353
350
|
},
|
|
354
351
|
fire: CountConfig(ctx),
|
|
355
352
|
glowstone: CountConfig(ctx),
|
|
356
353
|
heightmap: {
|
|
357
|
-
heightmap:
|
|
354
|
+
heightmap: versioned(ctx, '1.17', literal(HeightmapType)),
|
|
358
355
|
},
|
|
359
356
|
heightmap_spread_double: {
|
|
360
|
-
heightmap:
|
|
357
|
+
heightmap: versioned(ctx, '1.17', literal(HeightmapType)),
|
|
361
358
|
},
|
|
362
359
|
lava_lake: {
|
|
363
|
-
chance:
|
|
360
|
+
chance: int,
|
|
364
361
|
},
|
|
365
362
|
range: {
|
|
366
|
-
...
|
|
367
|
-
height:
|
|
363
|
+
...versioned(ctx, RangeConfig, '1.17', {
|
|
364
|
+
height: height_provider,
|
|
368
365
|
}),
|
|
369
366
|
},
|
|
370
367
|
range_biased: RangeConfig,
|
|
371
368
|
range_very_biased: RangeConfig,
|
|
372
369
|
water_depth_threshold: {
|
|
373
|
-
max_water_depth:
|
|
370
|
+
max_water_depth: int,
|
|
374
371
|
},
|
|
375
372
|
water_lake: {
|
|
376
|
-
chance:
|
|
373
|
+
chance: int,
|
|
377
374
|
},
|
|
378
375
|
})),
|
|
379
376
|
})));
|
|
380
|
-
|
|
381
|
-
type:
|
|
382
|
-
...
|
|
377
|
+
export const placement_modifier = as('placement_modifier', dispatch('type', type => record({
|
|
378
|
+
type: resource('worldgen/placement_modifier_type'),
|
|
379
|
+
...pick(type, {
|
|
383
380
|
block_predicate_filter: {
|
|
384
381
|
predicate: block_predicate_worldgen,
|
|
385
382
|
},
|
|
386
383
|
carving_mask: {
|
|
387
|
-
step:
|
|
384
|
+
step: literal(['air', 'liquid']),
|
|
388
385
|
},
|
|
389
386
|
rarity_filter: {
|
|
390
|
-
chance:
|
|
387
|
+
chance: intRange(1, undefined),
|
|
391
388
|
},
|
|
392
389
|
count: {
|
|
393
|
-
count:
|
|
390
|
+
count: intProvider(0, 256),
|
|
394
391
|
},
|
|
395
392
|
count_on_every_layer: {
|
|
396
|
-
count:
|
|
393
|
+
count: intProvider(0, 256),
|
|
397
394
|
},
|
|
398
395
|
noise_threshold_count: {
|
|
399
|
-
noise_level:
|
|
400
|
-
below_noise:
|
|
401
|
-
above_noise:
|
|
396
|
+
noise_level: float,
|
|
397
|
+
below_noise: int,
|
|
398
|
+
above_noise: int,
|
|
402
399
|
},
|
|
403
400
|
noise_based_count: {
|
|
404
|
-
noise_to_count_ratio:
|
|
405
|
-
noise_factor:
|
|
406
|
-
noise_offset:
|
|
401
|
+
noise_to_count_ratio: int,
|
|
402
|
+
noise_factor: float,
|
|
403
|
+
noise_offset: opt(float),
|
|
407
404
|
},
|
|
408
405
|
environment_scan: {
|
|
409
|
-
direction_of_search:
|
|
410
|
-
max_steps:
|
|
406
|
+
direction_of_search: literal(['up', 'down']),
|
|
407
|
+
max_steps: intRange(1, 32),
|
|
411
408
|
target_condition: block_predicate_worldgen,
|
|
412
|
-
allowed_search_condition:
|
|
409
|
+
allowed_search_condition: opt(block_predicate_worldgen),
|
|
413
410
|
},
|
|
414
411
|
heightmap: {
|
|
415
|
-
heightmap:
|
|
412
|
+
heightmap: literal(HeightmapType),
|
|
416
413
|
},
|
|
417
414
|
height_range: {
|
|
418
|
-
height:
|
|
415
|
+
height: height_provider,
|
|
419
416
|
},
|
|
420
417
|
random_offset: {
|
|
421
|
-
xz_spread:
|
|
422
|
-
y_spread:
|
|
418
|
+
xz_spread: intProvider(-16, 16),
|
|
419
|
+
y_spread: intProvider(-16, 16),
|
|
423
420
|
},
|
|
424
421
|
surface_relative_threshold_filter: {
|
|
425
|
-
heigtmap:
|
|
426
|
-
min_inclusive:
|
|
427
|
-
max_inclusive:
|
|
422
|
+
heigtmap: literal(HeightmapType),
|
|
423
|
+
min_inclusive: opt(int),
|
|
424
|
+
max_inclusive: opt(int),
|
|
428
425
|
},
|
|
429
426
|
surface_water_depth_filter: {
|
|
430
|
-
max_water_depth:
|
|
427
|
+
max_water_depth: int,
|
|
431
428
|
},
|
|
432
429
|
}),
|
|
433
430
|
})));
|
|
434
|
-
|
|
435
|
-
type:
|
|
436
|
-
config:
|
|
431
|
+
export const configured_feature = as('feature', dispatch('type', (type, _, ctx) => record({
|
|
432
|
+
type: resource('worldgen/feature'),
|
|
433
|
+
config: record(pick(type, {
|
|
437
434
|
bamboo: {
|
|
438
|
-
probability:
|
|
435
|
+
probability: floatRange(0, 1),
|
|
439
436
|
},
|
|
440
437
|
basalt_columns: {
|
|
441
|
-
reach:
|
|
442
|
-
height:
|
|
438
|
+
reach: versioned(ctx, uniformInt(0, 2, 1), '1.17', intProvider(0, 3)),
|
|
439
|
+
height: versioned(ctx, uniformInt(1, 5, 5), '1.17', intProvider(1, 10)),
|
|
443
440
|
},
|
|
444
441
|
block_column: {
|
|
445
|
-
direction:
|
|
442
|
+
direction: literal(Direction),
|
|
446
443
|
allowed_placement: block_predicate_worldgen,
|
|
447
|
-
prioritize_tip:
|
|
448
|
-
layers:
|
|
449
|
-
height:
|
|
444
|
+
prioritize_tip: boolean,
|
|
445
|
+
layers: listOf(record({
|
|
446
|
+
height: intProvider(0, undefined),
|
|
450
447
|
provider: block_state_provider,
|
|
451
448
|
})),
|
|
452
449
|
},
|
|
@@ -454,280 +451,280 @@ exports.configured_feature = (0, primitives_1.as)('feature', (0, primitives_1.di
|
|
|
454
451
|
state_provider: block_state_provider,
|
|
455
452
|
},
|
|
456
453
|
decorated: {
|
|
457
|
-
decorator:
|
|
458
|
-
feature:
|
|
454
|
+
decorator: configured_decorator,
|
|
455
|
+
feature: configured_feature_ref,
|
|
459
456
|
},
|
|
460
457
|
delta_feature: {
|
|
461
|
-
contents:
|
|
462
|
-
rim:
|
|
463
|
-
size:
|
|
464
|
-
rim_size:
|
|
458
|
+
contents: block_state,
|
|
459
|
+
rim: block_state,
|
|
460
|
+
size: versioned(ctx, uniformInt(0, 8, 8), '1.17', intProvider(0, 16)),
|
|
461
|
+
rim_size: versioned(ctx, uniformInt(0, 8, 8), '1.17', intProvider(0, 16)),
|
|
465
462
|
},
|
|
466
463
|
disk: DiskConfig(ctx),
|
|
467
464
|
dripstone_cluster: {
|
|
468
|
-
floor_to_ceiling_search_range:
|
|
469
|
-
height:
|
|
470
|
-
radius:
|
|
471
|
-
max_stalagmite_stalactite_height_diff:
|
|
472
|
-
height_deviation:
|
|
473
|
-
dripstone_block_layer_thickness:
|
|
474
|
-
density:
|
|
475
|
-
wetness:
|
|
476
|
-
chance_of_dripstone_column_at_max_distance_from_center:
|
|
477
|
-
max_distance_from_edge_affecting_chance_of_dripstone_column:
|
|
478
|
-
max_distance_from_center_affecting_height_bias:
|
|
465
|
+
floor_to_ceiling_search_range: intRange(1, 512),
|
|
466
|
+
height: intProvider(0, 128),
|
|
467
|
+
radius: intProvider(0, 128),
|
|
468
|
+
max_stalagmite_stalactite_height_diff: intRange(0, 64),
|
|
469
|
+
height_deviation: intRange(0, 64),
|
|
470
|
+
dripstone_block_layer_thickness: intProvider(0, 128),
|
|
471
|
+
density: floatProvider(0, 2),
|
|
472
|
+
wetness: floatProvider(0, 2),
|
|
473
|
+
chance_of_dripstone_column_at_max_distance_from_center: floatRange(0, 1),
|
|
474
|
+
max_distance_from_edge_affecting_chance_of_dripstone_column: intRange(1, 64),
|
|
475
|
+
max_distance_from_center_affecting_height_bias: intRange(1, 64),
|
|
479
476
|
},
|
|
480
477
|
emerald_ore: {
|
|
481
|
-
state:
|
|
482
|
-
target:
|
|
478
|
+
state: block_state,
|
|
479
|
+
target: block_state,
|
|
483
480
|
},
|
|
484
481
|
end_gateway: {
|
|
485
|
-
exit:
|
|
486
|
-
exact:
|
|
482
|
+
exit: opt(listOf(int)),
|
|
483
|
+
exact: boolean,
|
|
487
484
|
},
|
|
488
485
|
end_spike: {
|
|
489
|
-
crystal_invulnerable:
|
|
490
|
-
crystal_beam_target:
|
|
491
|
-
spikes:
|
|
492
|
-
centerX:
|
|
493
|
-
centerZ:
|
|
494
|
-
radius:
|
|
495
|
-
height:
|
|
496
|
-
guarded:
|
|
486
|
+
crystal_invulnerable: opt(boolean, false),
|
|
487
|
+
crystal_beam_target: opt(listOf(int)),
|
|
488
|
+
spikes: listOf(record({
|
|
489
|
+
centerX: opt(int, 0),
|
|
490
|
+
centerZ: opt(int, 0),
|
|
491
|
+
radius: opt(int, 0),
|
|
492
|
+
height: opt(int, 0),
|
|
493
|
+
guarded: opt(boolean, false),
|
|
497
494
|
})),
|
|
498
495
|
},
|
|
499
496
|
fill_layer: {
|
|
500
|
-
height:
|
|
501
|
-
state:
|
|
497
|
+
height: intRange(0, Y_SIZE),
|
|
498
|
+
state: block_state,
|
|
502
499
|
},
|
|
503
500
|
flower: RandomPatchConfig(ctx),
|
|
504
501
|
forest_rock: {
|
|
505
|
-
state:
|
|
502
|
+
state: block_state,
|
|
506
503
|
},
|
|
507
504
|
fossil: {
|
|
508
|
-
max_empty_corners_allowed:
|
|
509
|
-
fossil_structures:
|
|
510
|
-
overlay_structures:
|
|
511
|
-
fossil_processors:
|
|
512
|
-
overlay_processors:
|
|
505
|
+
max_empty_corners_allowed: intRange(0, 7),
|
|
506
|
+
fossil_structures: listOf(resource('structure')),
|
|
507
|
+
overlay_structures: listOf(resource('structure')),
|
|
508
|
+
fossil_processors: processor_list_ref,
|
|
509
|
+
overlay_processors: processor_list_ref,
|
|
513
510
|
},
|
|
514
511
|
geode: {
|
|
515
|
-
blocks:
|
|
512
|
+
blocks: record({
|
|
516
513
|
filling_provider: block_state_provider,
|
|
517
514
|
inner_layer_provider: block_state_provider,
|
|
518
515
|
alternate_inner_layer_provider: block_state_provider,
|
|
519
516
|
middle_layer_provider: block_state_provider,
|
|
520
517
|
outer_layer_provider: block_state_provider,
|
|
521
|
-
inner_placements:
|
|
522
|
-
cannot_replace:
|
|
523
|
-
invalid_blocks:
|
|
518
|
+
inner_placements: listOf(block_state),
|
|
519
|
+
cannot_replace: resource('tag/block'),
|
|
520
|
+
invalid_blocks: resource('tag/block'),
|
|
524
521
|
}),
|
|
525
|
-
layers:
|
|
526
|
-
filling:
|
|
527
|
-
inner_layer:
|
|
528
|
-
middle_layer:
|
|
529
|
-
outer_layer:
|
|
522
|
+
layers: record({
|
|
523
|
+
filling: opt(floatRange(0.01, 50), 1.7),
|
|
524
|
+
inner_layer: opt(floatRange(0.01, 50), 2.2),
|
|
525
|
+
middle_layer: opt(floatRange(0.01, 50), 3.2),
|
|
526
|
+
outer_layer: opt(floatRange(0.01, 50), 4.2),
|
|
530
527
|
}),
|
|
531
|
-
crack:
|
|
532
|
-
generate_crack_chance:
|
|
533
|
-
base_crack_size:
|
|
534
|
-
crack_point_offset:
|
|
528
|
+
crack: record({
|
|
529
|
+
generate_crack_chance: opt(floatRange(0, 1), 1),
|
|
530
|
+
base_crack_size: opt(floatRange(0, 5), 2),
|
|
531
|
+
crack_point_offset: opt(intRange(0, 10), 2),
|
|
535
532
|
}),
|
|
536
|
-
noise_multiplier:
|
|
537
|
-
use_potential_placements_chance:
|
|
538
|
-
use_alternate_layer0_chance:
|
|
539
|
-
placements_require_layer0_alternate:
|
|
540
|
-
outer_wall_distance:
|
|
541
|
-
distribution_points:
|
|
542
|
-
point_offset:
|
|
543
|
-
min_gen_offset:
|
|
544
|
-
max_gen_offset:
|
|
545
|
-
invalid_blocks_threshold:
|
|
533
|
+
noise_multiplier: opt(floatRange(0, 1), 0.05),
|
|
534
|
+
use_potential_placements_chance: opt(floatRange(0, 1), 0.35),
|
|
535
|
+
use_alternate_layer0_chance: opt(floatRange(0, 1), 0),
|
|
536
|
+
placements_require_layer0_alternate: opt(boolean, true),
|
|
537
|
+
outer_wall_distance: opt(intProvider(0, 10), { value: { min_inclusive: 0, max_inclusive: 10 } }),
|
|
538
|
+
distribution_points: opt(intProvider(1, 20), { value: { min_inclusive: 3, max_inclusive: 4 } }),
|
|
539
|
+
point_offset: opt(intProvider(0, 10), { value: { min_inclusive: 1, max_inclusive: 2 } }),
|
|
540
|
+
min_gen_offset: opt(int, -16),
|
|
541
|
+
max_gen_offset: opt(int, 16),
|
|
542
|
+
invalid_blocks_threshold: int,
|
|
546
543
|
},
|
|
547
544
|
glow_lichen: {
|
|
548
|
-
search_range:
|
|
549
|
-
chance_of_spreading:
|
|
550
|
-
can_place_on_floor:
|
|
551
|
-
can_place_on_wall:
|
|
552
|
-
can_place_on_ceiling:
|
|
553
|
-
can_be_placed_on:
|
|
545
|
+
search_range: opt(intRange(1, 64), 10),
|
|
546
|
+
chance_of_spreading: opt(floatRange(0, 1), 0.5),
|
|
547
|
+
can_place_on_floor: opt(boolean, false),
|
|
548
|
+
can_place_on_wall: opt(boolean, false),
|
|
549
|
+
can_place_on_ceiling: opt(boolean, false),
|
|
550
|
+
can_be_placed_on: listOf(versioned(ctx, block_state, '1.18', resource('block'))),
|
|
554
551
|
},
|
|
555
552
|
growing_plant: {
|
|
556
|
-
direction:
|
|
557
|
-
allow_water:
|
|
558
|
-
height_distribution:
|
|
559
|
-
weight:
|
|
560
|
-
data:
|
|
553
|
+
direction: literal(Direction),
|
|
554
|
+
allow_water: boolean,
|
|
555
|
+
height_distribution: listOf(record({
|
|
556
|
+
weight: int,
|
|
557
|
+
data: intProvider(),
|
|
561
558
|
})),
|
|
562
559
|
body_provider: block_state_provider,
|
|
563
560
|
head_provider: block_state_provider,
|
|
564
561
|
},
|
|
565
562
|
huge_brown_mushroom: HugeMushroomConfig,
|
|
566
563
|
huge_fungus: {
|
|
567
|
-
planted:
|
|
568
|
-
hat_state:
|
|
569
|
-
decor_state:
|
|
570
|
-
stem_state:
|
|
571
|
-
valid_base_block:
|
|
564
|
+
planted: opt(boolean, false),
|
|
565
|
+
hat_state: block_state,
|
|
566
|
+
decor_state: block_state,
|
|
567
|
+
stem_state: block_state,
|
|
568
|
+
valid_base_block: block_state,
|
|
572
569
|
},
|
|
573
570
|
huge_red_mushroom: HugeMushroomConfig,
|
|
574
571
|
ice_patch: DiskConfig(ctx),
|
|
575
572
|
iceberg: {
|
|
576
|
-
state:
|
|
573
|
+
state: block_state,
|
|
577
574
|
},
|
|
578
|
-
lake:
|
|
579
|
-
state:
|
|
575
|
+
lake: versioned(ctx, {
|
|
576
|
+
state: block_state,
|
|
580
577
|
}, '1.18', {
|
|
581
578
|
fluid: block_state_provider,
|
|
582
579
|
barrier: block_state_provider,
|
|
583
580
|
}),
|
|
584
581
|
large_dripstone: {
|
|
585
|
-
floor_to_ceiling_search_range:
|
|
586
|
-
column_radius:
|
|
587
|
-
height_scale:
|
|
588
|
-
max_column_radius_to_cave_height_ratio:
|
|
589
|
-
stalactite_bluntness:
|
|
590
|
-
stalagmite_bluntness:
|
|
591
|
-
wind_speed:
|
|
592
|
-
min_radius_for_wind:
|
|
593
|
-
min_bluntness_for_wind:
|
|
582
|
+
floor_to_ceiling_search_range: opt(intRange(1, 512), 30),
|
|
583
|
+
column_radius: intProvider(0, 20),
|
|
584
|
+
height_scale: floatProvider(0, 20),
|
|
585
|
+
max_column_radius_to_cave_height_ratio: floatRange(0, 1),
|
|
586
|
+
stalactite_bluntness: floatProvider(0.1, 10),
|
|
587
|
+
stalagmite_bluntness: floatProvider(0.1, 10),
|
|
588
|
+
wind_speed: floatProvider(0, 2),
|
|
589
|
+
min_radius_for_wind: intRange(0, 100),
|
|
590
|
+
min_bluntness_for_wind: floatRange(0, 5),
|
|
594
591
|
},
|
|
595
592
|
nether_forest_vegetation: {
|
|
596
593
|
state_provider: block_state_provider,
|
|
597
|
-
...
|
|
598
|
-
spread_width:
|
|
599
|
-
spread_height:
|
|
594
|
+
...versioned(ctx, '1.18', {
|
|
595
|
+
spread_width: intRange(1, undefined),
|
|
596
|
+
spread_height: intProvider(1, undefined),
|
|
600
597
|
}),
|
|
601
598
|
},
|
|
602
599
|
netherrack_replace_blobs: {
|
|
603
|
-
radius:
|
|
604
|
-
state:
|
|
605
|
-
target:
|
|
600
|
+
radius: versioned(ctx, uniformInt(), '1.17', intProvider(0, 12)),
|
|
601
|
+
state: block_state,
|
|
602
|
+
target: block_state,
|
|
606
603
|
},
|
|
607
604
|
no_bonemeal_flower: RandomPatchConfig(ctx),
|
|
608
605
|
no_surface_ore: OreConfig(ctx),
|
|
609
606
|
ore: OreConfig(ctx),
|
|
610
607
|
pointed_dripstone: {
|
|
611
|
-
chance_of_taller_dripstone:
|
|
612
|
-
chance_of_directional_spread:
|
|
613
|
-
chance_of_spread_radius2:
|
|
614
|
-
chance_of_spread_radius3:
|
|
608
|
+
chance_of_taller_dripstone: floatRange(0, 1),
|
|
609
|
+
chance_of_directional_spread: floatRange(0, 1),
|
|
610
|
+
chance_of_spread_radius2: floatRange(0, 1),
|
|
611
|
+
chance_of_spread_radius3: floatRange(0, 1),
|
|
615
612
|
},
|
|
616
613
|
random_boolean_selector: {
|
|
617
|
-
feature_false:
|
|
618
|
-
feature_true:
|
|
614
|
+
feature_false: versioned(ctx, configured_feature_ref, '1.18', placed_feature_ref),
|
|
615
|
+
feature_true: versioned(ctx, configured_feature_ref, '1.18', placed_feature_ref),
|
|
619
616
|
},
|
|
620
617
|
random_patch: RandomPatchConfig(ctx),
|
|
621
618
|
random_selector: {
|
|
622
|
-
features:
|
|
623
|
-
chance:
|
|
624
|
-
feature:
|
|
619
|
+
features: listOf(record({
|
|
620
|
+
chance: floatRange(0, 1),
|
|
621
|
+
feature: versioned(ctx, configured_feature_ref, '1.18', placed_feature_ref),
|
|
625
622
|
})),
|
|
626
|
-
default:
|
|
623
|
+
default: versioned(ctx, configured_feature_ref, '1.18', placed_feature_ref),
|
|
627
624
|
},
|
|
628
625
|
replace_single_block: {
|
|
629
|
-
targets:
|
|
630
|
-
state:
|
|
631
|
-
target:
|
|
626
|
+
targets: listOf(record({
|
|
627
|
+
state: block_state,
|
|
628
|
+
target: rule_test,
|
|
632
629
|
})),
|
|
633
630
|
},
|
|
634
631
|
root_system: {
|
|
635
|
-
required_vertical_space_for_tree:
|
|
636
|
-
root_radius:
|
|
637
|
-
root_placement_attempts:
|
|
638
|
-
root_column_max_height:
|
|
639
|
-
hanging_root_radius:
|
|
640
|
-
hanging_roots_vertical_span:
|
|
641
|
-
hanging_root_placement_attempts:
|
|
642
|
-
allowed_vertical_water_for_tree:
|
|
643
|
-
root_replaceable:
|
|
632
|
+
required_vertical_space_for_tree: intRange(1, 64),
|
|
633
|
+
root_radius: intRange(1, 64),
|
|
634
|
+
root_placement_attempts: intRange(1, 256),
|
|
635
|
+
root_column_max_height: intRange(1, 4096),
|
|
636
|
+
hanging_root_radius: intRange(1, 64),
|
|
637
|
+
hanging_roots_vertical_span: intRange(0, 16),
|
|
638
|
+
hanging_root_placement_attempts: intRange(0, 256),
|
|
639
|
+
allowed_vertical_water_for_tree: intRange(1, 64),
|
|
640
|
+
root_replaceable: resource('tag/block'),
|
|
644
641
|
root_state_provider: block_state_provider,
|
|
645
642
|
hanging_root_state_provider: block_state_provider,
|
|
646
|
-
allowed_tree_position:
|
|
647
|
-
feature:
|
|
643
|
+
allowed_tree_position: versioned(ctx, '1.18', block_predicate_worldgen),
|
|
644
|
+
feature: versioned(ctx, configured_feature_ref, '1.18', placed_feature_ref),
|
|
648
645
|
},
|
|
649
646
|
scattered_ore: OreConfig(ctx),
|
|
650
647
|
sea_pickle: CountConfig(ctx),
|
|
651
648
|
seagrass: {
|
|
652
|
-
probability:
|
|
649
|
+
probability: floatRange(0, 1),
|
|
653
650
|
},
|
|
654
651
|
simple_block: {
|
|
655
|
-
...
|
|
656
|
-
to_place:
|
|
657
|
-
place_on:
|
|
658
|
-
place_in:
|
|
659
|
-
place_under:
|
|
652
|
+
...versioned(ctx, versioned(ctx, {
|
|
653
|
+
to_place: block_state,
|
|
654
|
+
place_on: listOf(block_state),
|
|
655
|
+
place_in: listOf(block_state),
|
|
656
|
+
place_under: listOf(block_state),
|
|
660
657
|
}, '1.17', {
|
|
661
658
|
to_place: block_state_provider,
|
|
662
|
-
place_on:
|
|
663
|
-
place_in:
|
|
664
|
-
place_under:
|
|
659
|
+
place_on: opt(listOf(block_state), []),
|
|
660
|
+
place_in: opt(listOf(block_state), []),
|
|
661
|
+
place_under: opt(listOf(block_state), []),
|
|
665
662
|
}), '1.18', {
|
|
666
663
|
to_place: block_state_provider,
|
|
667
664
|
}),
|
|
668
665
|
},
|
|
669
666
|
simple_random_selector: {
|
|
670
|
-
features:
|
|
667
|
+
features: versioned(ctx, configured_feature_list_ref, '1.18', placed_feature_list_ref),
|
|
671
668
|
},
|
|
672
669
|
small_dripstone: {
|
|
673
|
-
max_placements:
|
|
674
|
-
empty_space_search_radius:
|
|
675
|
-
max_offset_from_origin:
|
|
676
|
-
chance_of_taller_dripstone:
|
|
670
|
+
max_placements: opt(intRange(0, 100), 5),
|
|
671
|
+
empty_space_search_radius: opt(intRange(0, 20), 10),
|
|
672
|
+
max_offset_from_origin: opt(intRange(0, 20), 2),
|
|
673
|
+
chance_of_taller_dripstone: opt(floatRange(0, 1), 0.2),
|
|
677
674
|
},
|
|
678
675
|
spring_feature: {
|
|
679
|
-
requires_block_below:
|
|
680
|
-
rock_count:
|
|
681
|
-
hole_count:
|
|
682
|
-
state:
|
|
683
|
-
valid_blocks:
|
|
676
|
+
requires_block_below: opt(boolean, true),
|
|
677
|
+
rock_count: opt(int, 4),
|
|
678
|
+
hole_count: opt(int, 1),
|
|
679
|
+
state: fluid_state,
|
|
680
|
+
valid_blocks: listOf(resource('block')),
|
|
684
681
|
},
|
|
685
682
|
tree: {
|
|
686
|
-
ignore_vines:
|
|
687
|
-
force_dirt:
|
|
688
|
-
max_water_depth:
|
|
689
|
-
heightmap:
|
|
683
|
+
ignore_vines: opt(boolean, false),
|
|
684
|
+
force_dirt: opt(versioned(ctx, '1.17', boolean), false),
|
|
685
|
+
max_water_depth: versioned(ctx, int, '1.17'),
|
|
686
|
+
heightmap: versioned(ctx, literal(HeightmapType), '1.17'),
|
|
690
687
|
minimum_size: feature_size,
|
|
691
|
-
dirt_provider:
|
|
692
|
-
sapling_provider:
|
|
688
|
+
dirt_provider: versioned(ctx, '1.17', block_state_provider),
|
|
689
|
+
sapling_provider: versioned(ctx, '1.17', versioned(ctx, block_state_provider, '1.18')),
|
|
693
690
|
trunk_provider: block_state_provider,
|
|
694
|
-
...
|
|
691
|
+
...renamed(ctx, 'leaves_provider', '1.17', 'foliage_provider', block_state_provider),
|
|
695
692
|
trunk_placer: trunk_placer,
|
|
696
693
|
foliage_placer: foliage_placer,
|
|
697
|
-
decorators:
|
|
694
|
+
decorators: listOf(tree_decorator),
|
|
698
695
|
},
|
|
699
|
-
twisting_vines:
|
|
700
|
-
spread_width:
|
|
701
|
-
spread_height:
|
|
702
|
-
max_height:
|
|
696
|
+
twisting_vines: versioned(ctx, {}, '1.18', {
|
|
697
|
+
spread_width: intRange(1, undefined),
|
|
698
|
+
spread_height: intRange(1, undefined),
|
|
699
|
+
max_height: intRange(1, undefined),
|
|
703
700
|
}),
|
|
704
701
|
underwater_magma: {
|
|
705
|
-
floor_search_range:
|
|
706
|
-
placement_radius_around_floor:
|
|
707
|
-
placement_probability_per_valid_position:
|
|
702
|
+
floor_search_range: intRange(0, 512),
|
|
703
|
+
placement_radius_around_floor: intRange(0, 64),
|
|
704
|
+
placement_probability_per_valid_position: floatRange(0, 1),
|
|
708
705
|
},
|
|
709
706
|
vegetation_patch: VegetationPatchConfig(ctx),
|
|
710
707
|
waterlogged_vegetation_patch: VegetationPatchConfig(ctx),
|
|
711
708
|
})),
|
|
712
709
|
})));
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
710
|
+
export const configured_feature_ref = any([
|
|
711
|
+
resource('worldgen/configured_feature'),
|
|
712
|
+
configured_feature,
|
|
716
713
|
]);
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
714
|
+
export const configured_feature_list_ref = any([
|
|
715
|
+
listOf(resource('worldgen/configured_feature')),
|
|
716
|
+
listOf(configured_feature),
|
|
720
717
|
]);
|
|
721
|
-
|
|
722
|
-
feature:
|
|
723
|
-
placement:
|
|
718
|
+
export const placed_feature = as('placed_feature', record({
|
|
719
|
+
feature: configured_feature_ref,
|
|
720
|
+
placement: listOf(placement_modifier),
|
|
724
721
|
}));
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
722
|
+
export const placed_feature_ref = any([
|
|
723
|
+
resource('worldgen/placed_feature'),
|
|
724
|
+
placed_feature,
|
|
728
725
|
]);
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
726
|
+
export const placed_feature_list_ref = any([
|
|
727
|
+
listOf(resource('worldgen/placed_feature')),
|
|
728
|
+
listOf(placed_feature),
|
|
732
729
|
]);
|
|
733
730
|
//# sourceMappingURL=feature.js.map
|