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