1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
const { JigsawStartHeight } = require('../../enum.js');
const jigsawConversionFields = {
type: 'minecraft:jigsaw',
start_pool: null,
size: 1,
start_height: {
absolute: {
value: 0,
},
},
max_distance_from_center: 1,
use_expansion_hack: false,
};
const jigsawStartHeightUniform = {
type: 'minecraft:uniform',
min_inclusive: {
above_bottom: 0,
},
max_inclusive: {
below_top: 0,
},
};
const jigsawStartHeightBiasedToBottom = {
type: 'minecraft:biased_to_bottom',
min_inclusive: {
above_bottom: 0,
},
max_inclusive: {
below_top: 0,
},
};
const jigsawStartHeightVeryBiasedToBottom = {
type: 'minecraft:very_biased_to_bottom',
min_inclusive: {
above_bottom: 0,
},
max_inclusive: {
below_top: 0,
},
};
function jigsawConversion(structure, fields) {
fields = Object.assign({
...jigsawConversionFields,
}, fields);
if (fields.start_height === JigsawStartHeight.UNIFORM) {
fields.start_height = jigsawStartHeightUniform;
}
else if (fields.start_height === JigsawStartHeight.BIASED_TO_BOTTOM) {
fields.start_height = jigsawStartHeightBiasedToBottom;
}
else if (fields.start_height === JigsawStartHeight.VERY_BIASED_TO_BOTTOM) {
fields.start_height = jigsawStartHeightVeryBiasedToBottom;
}
return Object.assign({}, structure, fields);
}
module.exports = {
jigsawConversionFields,
jigsawStartHeightUniform,
jigsawStartHeightBiasedToBottom,
jigsawStartHeightVeryBiasedToBottom,
jigsawConversion,
};
|