@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,4 @@
|
|
|
1
|
+
import type { JsonChecker } from '@spyglassmc/json/lib/checker/JsonChecker';
|
|
2
|
+
export declare const pack_mcmeta: JsonChecker;
|
|
3
|
+
export declare const Checkers: Map<"function" | "worldgen/biome" | "worldgen/configured_carver" | "worldgen/configured_feature" | "worldgen/configured_structure_feature" | "worldgen/configured_surface_builder" | "worldgen/noise" | "worldgen/noise_settings" | "worldgen/placed_feature" | "worldgen/processor_list" | "worldgen/template_pool" | "tag/function" | "tag/block" | "tag/activity" | "tag/attribute" | "tag/block_entity_type" | "tag/block_predicate_type" | "tag/chunk_status" | "tag/custom_stat" | "tag/enchantment" | "tag/entity_type" | "tag/float_provider_type" | "tag/fluid" | "tag/game_event" | "tag/height_provider_type" | "tag/int_provider_type" | "tag/item" | "tag/loot_condition_type" | "tag/loot_function_type" | "tag/loot_nbt_provider_type" | "tag/loot_number_provider_type" | "tag/loot_pool_entry_type" | "tag/loot_score_provider_type" | "tag/memory_module_type" | "tag/menu" | "tag/mob_effect" | "tag/motive" | "tag/particle_type" | "tag/point_of_interest_type" | "tag/pos_rule_test" | "tag/position_source_type" | "tag/potion" | "tag/recipe_serializer" | "tag/recipe_type" | "tag/rule_test" | "tag/schedule" | "tag/sensor_type" | "tag/sound_event" | "tag/stat_type" | "tag/villager_profession" | "tag/villager_type" | "tag/worldgen/biome_source" | "tag/worldgen/block_placer_type" | "tag/worldgen/block_state_provider_type" | "tag/worldgen/carver" | "tag/worldgen/chunk_generator" | "tag/worldgen/decorator" | "tag/worldgen/feature" | "tag/worldgen/feature_size_type" | "tag/worldgen/foliage_placer_type" | "tag/worldgen/material_condition" | "tag/worldgen/material_rule" | "tag/worldgen/placement_modifier_type" | "tag/worldgen/structure_feature" | "tag/worldgen/structure_piece" | "tag/worldgen/structure_pool_element" | "tag/worldgen/structure_processor" | "tag/worldgen/surface_builder" | "tag/worldgen/tree_decorator_type" | "tag/worldgen/trunk_placer_type" | "tag/worldgen/biome" | "tag/worldgen/configured_carver" | "tag/worldgen/configured_feature" | "tag/worldgen/configured_structure_feature" | "tag/worldgen/configured_surface_builder" | "tag/worldgen/noise" | "tag/worldgen/noise_settings" | "tag/worldgen/placed_feature" | "tag/worldgen/processor_list" | "tag/worldgen/template_pool" | "advancement" | "dimension" | "dimension_type" | "item_modifier" | "loot_table" | "predicate" | "recipe" | "structure", JsonChecker>;
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Checkers = exports.pack_mcmeta = void 0;
|
|
4
|
+
const checker_1 = require("@spyglassmc/json/lib/checker");
|
|
5
|
+
const advancement_1 = require("./advancement");
|
|
6
|
+
const biome_1 = require("./biome");
|
|
7
|
+
const dimension_1 = require("./dimension");
|
|
8
|
+
const feature_1 = require("./feature");
|
|
9
|
+
const loot_table_1 = require("./loot_table");
|
|
10
|
+
const recipe_1 = require("./recipe");
|
|
11
|
+
const structure_1 = require("./structure");
|
|
12
|
+
const tag_1 = require("./tag");
|
|
13
|
+
const text_component_1 = require("./text_component");
|
|
14
|
+
exports.pack_mcmeta = (0, checker_1.as)('pack', (0, checker_1.record)({
|
|
15
|
+
pack: (0, checker_1.record)({
|
|
16
|
+
pack_format: checker_1.int,
|
|
17
|
+
description: text_component_1.text_component,
|
|
18
|
+
}),
|
|
19
|
+
}, { allowUnknownProperties: true }));
|
|
20
|
+
exports.Checkers = new Map([
|
|
21
|
+
['advancement', advancement_1.advancement],
|
|
22
|
+
['dimension', dimension_1.dimension],
|
|
23
|
+
['dimension_type', dimension_1.dimension_type],
|
|
24
|
+
['item_modifier', loot_table_1.item_modifier_list],
|
|
25
|
+
['loot_table', loot_table_1.loot_table],
|
|
26
|
+
['predicate', loot_table_1.predicate_list],
|
|
27
|
+
['recipe', recipe_1.recipe],
|
|
28
|
+
['tag/block', tag_1.block_tag],
|
|
29
|
+
['tag/entity_type', tag_1.entity_type_tag],
|
|
30
|
+
['tag/fluid', tag_1.fluid_tag],
|
|
31
|
+
['tag/function', tag_1.function_tag],
|
|
32
|
+
['tag/game_event', tag_1.game_event_tag],
|
|
33
|
+
['tag/item', tag_1.item_tag],
|
|
34
|
+
['worldgen/biome', biome_1.biome],
|
|
35
|
+
['worldgen/configured_carver', biome_1.configured_carver],
|
|
36
|
+
['worldgen/configured_surface_builder', biome_1.configured_surface_builder],
|
|
37
|
+
['worldgen/configured_feature', feature_1.configured_feature],
|
|
38
|
+
['worldgen/configured_structure_feature', structure_1.configured_structure_feature],
|
|
39
|
+
['worldgen/noise_settings', dimension_1.noise_settings],
|
|
40
|
+
['worldgen/processor_list', structure_1.processor_list],
|
|
41
|
+
['worldgen/template_pool', structure_1.template_pool],
|
|
42
|
+
]);
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const predicate: import("@spyglassmc/json/lib/checker").JsonChecker;
|
|
2
|
+
export declare const predicate_list: import("@spyglassmc/json/lib/checker").JsonChecker;
|
|
3
|
+
export declare const item_modifier: import("@spyglassmc/json/lib/checker").JsonChecker;
|
|
4
|
+
export declare const item_modifier_list: import("@spyglassmc/json/lib/checker").JsonChecker;
|
|
5
|
+
export declare const loot_entry: import("@spyglassmc/json/lib/checker").JsonChecker;
|
|
6
|
+
export declare const loot_pool: import("@spyglassmc/json/lib/checker").JsonChecker;
|
|
7
|
+
export declare const loot_table: import("@spyglassmc/json/lib/checker").JsonChecker;
|
|
8
|
+
//# sourceMappingURL=loot_table.d.ts.map
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loot_table = exports.loot_pool = exports.loot_entry = exports.item_modifier_list = exports.item_modifier = exports.predicate_list = exports.predicate = void 0;
|
|
4
|
+
const primitives_1 = require("@spyglassmc/json/lib/checker/primitives");
|
|
5
|
+
const util_1 = require("../util");
|
|
6
|
+
const advancement_1 = require("./advancement");
|
|
7
|
+
const common_1 = require("./common");
|
|
8
|
+
const text_component_1 = require("./text_component");
|
|
9
|
+
const loot_context_types = [
|
|
10
|
+
'empty',
|
|
11
|
+
'chest',
|
|
12
|
+
'command',
|
|
13
|
+
'selector',
|
|
14
|
+
'fishing',
|
|
15
|
+
'entity',
|
|
16
|
+
'gift',
|
|
17
|
+
'barter',
|
|
18
|
+
'advancement_reward',
|
|
19
|
+
'advancement_entity',
|
|
20
|
+
'generic',
|
|
21
|
+
'block',
|
|
22
|
+
];
|
|
23
|
+
const map_decorations = [
|
|
24
|
+
'mansion',
|
|
25
|
+
'monument',
|
|
26
|
+
'player',
|
|
27
|
+
'frame',
|
|
28
|
+
'red_marker',
|
|
29
|
+
'blue_marker',
|
|
30
|
+
'target_x',
|
|
31
|
+
'target_point',
|
|
32
|
+
'player_off_map',
|
|
33
|
+
'player_off_limits',
|
|
34
|
+
'red_x',
|
|
35
|
+
'banner_white',
|
|
36
|
+
'banner_orange',
|
|
37
|
+
'banner_magenta',
|
|
38
|
+
'banner_light_blue',
|
|
39
|
+
'banner_yellow',
|
|
40
|
+
'banner_lime',
|
|
41
|
+
'banner_pink',
|
|
42
|
+
'banner_gray',
|
|
43
|
+
'banner_light_gray',
|
|
44
|
+
'banner_cyan',
|
|
45
|
+
'banner_purple',
|
|
46
|
+
'banner_blue',
|
|
47
|
+
'banner_brown',
|
|
48
|
+
'banner_green',
|
|
49
|
+
'banner_red',
|
|
50
|
+
'banner_black',
|
|
51
|
+
];
|
|
52
|
+
exports.predicate = (0, primitives_1.as)('predicate', (0, primitives_1.dispatch)('condition', (condition, props) => (0, primitives_1.record)({
|
|
53
|
+
condition: (0, primitives_1.resource)('loot_condition_type'),
|
|
54
|
+
...(0, primitives_1.pick)(condition, {
|
|
55
|
+
alternative: {
|
|
56
|
+
terms: (0, primitives_1.listOf)(exports.predicate),
|
|
57
|
+
},
|
|
58
|
+
block_state_property: {
|
|
59
|
+
block: (0, primitives_1.resource)('block'),
|
|
60
|
+
properties: (0, util_1.blockStateMap)({ id: (0, primitives_1.extract)('block', props) }),
|
|
61
|
+
},
|
|
62
|
+
damage_source_properties: {
|
|
63
|
+
predicate: advancement_1.damage_source_predicate,
|
|
64
|
+
},
|
|
65
|
+
entity_properties: {
|
|
66
|
+
entity: (0, primitives_1.literal)(['this', 'killer', 'killer_player', 'direct_killer']),
|
|
67
|
+
predicate: advancement_1.entity_predicate,
|
|
68
|
+
},
|
|
69
|
+
entity_scores: {
|
|
70
|
+
entity: (0, primitives_1.literal)(['this', 'killer', 'killer_player', 'direct_killer']),
|
|
71
|
+
scores: (0, primitives_1.object)((0, primitives_1.literal)('objective'), () => common_1.int_bounds),
|
|
72
|
+
},
|
|
73
|
+
inverted: {
|
|
74
|
+
term: exports.predicate,
|
|
75
|
+
},
|
|
76
|
+
killed_by_player: {
|
|
77
|
+
inverse: (0, primitives_1.opt)(primitives_1.boolean, false),
|
|
78
|
+
},
|
|
79
|
+
location_check: {
|
|
80
|
+
offsetX: (0, primitives_1.opt)(primitives_1.int, 0),
|
|
81
|
+
offsetY: (0, primitives_1.opt)(primitives_1.int, 0),
|
|
82
|
+
offsetZ: (0, primitives_1.opt)(primitives_1.int, 0),
|
|
83
|
+
predicate: advancement_1.location_predicate,
|
|
84
|
+
},
|
|
85
|
+
match_tool: {
|
|
86
|
+
predicate: advancement_1.item_predicate,
|
|
87
|
+
},
|
|
88
|
+
random_chance: {
|
|
89
|
+
chance: (0, primitives_1.floatRange)(0, 1),
|
|
90
|
+
},
|
|
91
|
+
random_chance_with_looting: {
|
|
92
|
+
chance: (0, primitives_1.floatRange)(0, 1),
|
|
93
|
+
looting_multiplier: primitives_1.float,
|
|
94
|
+
},
|
|
95
|
+
reference: {
|
|
96
|
+
name: (0, primitives_1.resource)('predicate'),
|
|
97
|
+
},
|
|
98
|
+
table_bonus: {
|
|
99
|
+
enchantment: (0, primitives_1.resource)('enchantment'),
|
|
100
|
+
chances: (0, primitives_1.listOf)((0, primitives_1.floatRange)(0, 1)),
|
|
101
|
+
},
|
|
102
|
+
time_check: {
|
|
103
|
+
value: common_1.int_bounds,
|
|
104
|
+
period: (0, primitives_1.opt)(primitives_1.int),
|
|
105
|
+
},
|
|
106
|
+
value_check: {
|
|
107
|
+
value: common_1.number_provider,
|
|
108
|
+
range: common_1.int_bounds,
|
|
109
|
+
},
|
|
110
|
+
weather_check: {
|
|
111
|
+
raining: (0, primitives_1.opt)(primitives_1.boolean),
|
|
112
|
+
thundering: (0, primitives_1.opt)(primitives_1.boolean),
|
|
113
|
+
},
|
|
114
|
+
}),
|
|
115
|
+
})));
|
|
116
|
+
exports.predicate_list = (0, primitives_1.any)([
|
|
117
|
+
exports.predicate,
|
|
118
|
+
(0, primitives_1.listOf)(exports.predicate),
|
|
119
|
+
]);
|
|
120
|
+
exports.item_modifier = (0, primitives_1.as)('item_modifier', (0, primitives_1.dispatch)('function', (function_, props, ctx) => (0, primitives_1.record)({
|
|
121
|
+
function: (0, primitives_1.resource)('loot_function_type'),
|
|
122
|
+
...(0, primitives_1.pick)(function_, {
|
|
123
|
+
apply_bonus: {
|
|
124
|
+
enchantment: (0, primitives_1.resource)('enchantment'),
|
|
125
|
+
formula: (0, primitives_1.resource)(['binomial_with_bonus_count', 'ore_drops', 'uniform_bonus_count']),
|
|
126
|
+
...(0, primitives_1.pick)((0, primitives_1.extract)('formula', props), {
|
|
127
|
+
binomial_with_bonus_count: {
|
|
128
|
+
parameters: (0, primitives_1.record)({
|
|
129
|
+
extra: primitives_1.float,
|
|
130
|
+
probability: (0, primitives_1.floatRange)(0, 1),
|
|
131
|
+
}),
|
|
132
|
+
},
|
|
133
|
+
uniform_bonus_count: {
|
|
134
|
+
parameters: (0, primitives_1.record)({
|
|
135
|
+
bonusMultiplier: primitives_1.float,
|
|
136
|
+
}),
|
|
137
|
+
},
|
|
138
|
+
}),
|
|
139
|
+
},
|
|
140
|
+
copy_name: {
|
|
141
|
+
source: (0, primitives_1.literal)(['this', 'killer', 'killer_player', 'block_entity']),
|
|
142
|
+
},
|
|
143
|
+
copy_nbt: {
|
|
144
|
+
source: common_1.nbt_provider,
|
|
145
|
+
ops: (0, primitives_1.listOf)((0, primitives_1.record)({
|
|
146
|
+
source: (0, util_1.nbtPath)({ registry: 'entity_type' }),
|
|
147
|
+
target: (0, util_1.nbtPath)({ registry: 'item' }),
|
|
148
|
+
op: (0, primitives_1.literal)(['replace', 'append', 'merge']),
|
|
149
|
+
})),
|
|
150
|
+
},
|
|
151
|
+
copy_state: {
|
|
152
|
+
block: (0, primitives_1.resource)('block'),
|
|
153
|
+
properties: (0, util_1.blockStateList)({ id: (0, primitives_1.extract)('block', props) }),
|
|
154
|
+
},
|
|
155
|
+
enchant_randomly: {
|
|
156
|
+
enchantments: (0, primitives_1.opt)((0, primitives_1.listOf)((0, primitives_1.resource)('enchantment'))),
|
|
157
|
+
},
|
|
158
|
+
enchant_with_levels: {
|
|
159
|
+
levels: common_1.number_provider,
|
|
160
|
+
treasure: (0, primitives_1.opt)(primitives_1.boolean, false),
|
|
161
|
+
},
|
|
162
|
+
exploration_map: {
|
|
163
|
+
destination: (0, primitives_1.opt)((0, primitives_1.resource)('worldgen/structure_feature'), 'buried_treasure'),
|
|
164
|
+
decoration: (0, primitives_1.opt)((0, primitives_1.literal)(map_decorations), 'mansion'),
|
|
165
|
+
zoom: (0, primitives_1.opt)(primitives_1.int, 2),
|
|
166
|
+
search_radius: (0, primitives_1.opt)(primitives_1.int, 50),
|
|
167
|
+
skip_existing_chunks: (0, primitives_1.opt)(primitives_1.boolean, true),
|
|
168
|
+
},
|
|
169
|
+
fill_player_head: {
|
|
170
|
+
entity: (0, primitives_1.literal)(['this', 'killer', 'killer_player', 'direct_killer']),
|
|
171
|
+
},
|
|
172
|
+
limit_count: {
|
|
173
|
+
limit: common_1.int_bounds,
|
|
174
|
+
},
|
|
175
|
+
looting_enchant: {
|
|
176
|
+
count: common_1.number_provider,
|
|
177
|
+
limit: (0, primitives_1.opt)(primitives_1.int, 0),
|
|
178
|
+
},
|
|
179
|
+
set_attributes: {
|
|
180
|
+
modifiers: (0, primitives_1.listOf)((0, primitives_1.record)({
|
|
181
|
+
attribute: (0, primitives_1.resource)('attribute'),
|
|
182
|
+
name: primitives_1.simpleString,
|
|
183
|
+
operation: (0, primitives_1.literal)(['addition', 'multiply_base', 'multiply_total']),
|
|
184
|
+
id: (0, primitives_1.opt)(util_1.uuid),
|
|
185
|
+
amount: common_1.number_provider,
|
|
186
|
+
slot: (0, primitives_1.any)([
|
|
187
|
+
(0, primitives_1.literal)(common_1.Slots),
|
|
188
|
+
(0, primitives_1.listOf)((0, primitives_1.literal)(common_1.Slots)),
|
|
189
|
+
]),
|
|
190
|
+
})),
|
|
191
|
+
},
|
|
192
|
+
set_contents: {
|
|
193
|
+
type: (0, util_1.versioned)(ctx, '1.18', (0, primitives_1.resource)('block_entity_type')),
|
|
194
|
+
entries: (0, primitives_1.listOf)(exports.loot_entry),
|
|
195
|
+
},
|
|
196
|
+
set_count: {
|
|
197
|
+
count: common_1.number_provider,
|
|
198
|
+
add: (0, primitives_1.opt)((0, util_1.versioned)(ctx, '1.17', primitives_1.boolean), false),
|
|
199
|
+
},
|
|
200
|
+
set_damage: {
|
|
201
|
+
damage: common_1.number_provider,
|
|
202
|
+
add: (0, primitives_1.opt)((0, util_1.versioned)(ctx, '1.17', primitives_1.boolean), false),
|
|
203
|
+
},
|
|
204
|
+
set_loot_table: {
|
|
205
|
+
name: (0, primitives_1.resource)('loot_table'),
|
|
206
|
+
seed: (0, primitives_1.opt)(primitives_1.int, 0),
|
|
207
|
+
},
|
|
208
|
+
set_lore: {
|
|
209
|
+
entity: (0, primitives_1.opt)((0, primitives_1.literal)(['this', 'killer', 'killer_player', 'direct_killer'])),
|
|
210
|
+
lore: (0, primitives_1.listOf)(text_component_1.text_component),
|
|
211
|
+
replace: (0, primitives_1.opt)(primitives_1.boolean, false),
|
|
212
|
+
},
|
|
213
|
+
set_name: {
|
|
214
|
+
entity: (0, primitives_1.opt)((0, primitives_1.literal)(['this', 'killer', 'killer_player', 'direct_killer'])),
|
|
215
|
+
name: (0, primitives_1.opt)(text_component_1.text_component),
|
|
216
|
+
},
|
|
217
|
+
set_nbt: {
|
|
218
|
+
tag: (0, util_1.nbt)({ registry: 'item' }),
|
|
219
|
+
},
|
|
220
|
+
set_potion: {
|
|
221
|
+
id: (0, primitives_1.resource)('potion'),
|
|
222
|
+
},
|
|
223
|
+
set_stew_effect: {
|
|
224
|
+
effects: (0, primitives_1.opt)((0, primitives_1.listOf)((0, primitives_1.record)({
|
|
225
|
+
type: (0, primitives_1.resource)('mob_effect'),
|
|
226
|
+
duration: common_1.number_provider,
|
|
227
|
+
})), []),
|
|
228
|
+
},
|
|
229
|
+
}),
|
|
230
|
+
conditions: (0, primitives_1.opt)((0, primitives_1.listOf)(exports.predicate)),
|
|
231
|
+
})));
|
|
232
|
+
exports.item_modifier_list = (0, primitives_1.any)([
|
|
233
|
+
exports.item_modifier,
|
|
234
|
+
(0, primitives_1.listOf)(exports.item_modifier),
|
|
235
|
+
]);
|
|
236
|
+
exports.loot_entry = (0, primitives_1.as)('loot_entry', (0, primitives_1.dispatch)('type', (type) => (0, primitives_1.record)({
|
|
237
|
+
type: (0, primitives_1.resource)('loot_pool_entry_type'),
|
|
238
|
+
weight: (0, primitives_1.opt)((0, primitives_1.intRange)(1, undefined), 1),
|
|
239
|
+
quality: (0, primitives_1.opt)(primitives_1.int, 0),
|
|
240
|
+
...(0, primitives_1.pick)(type, {
|
|
241
|
+
alternatives: {
|
|
242
|
+
children: (0, primitives_1.listOf)(exports.loot_entry),
|
|
243
|
+
},
|
|
244
|
+
dynamic: {
|
|
245
|
+
name: (0, primitives_1.resource)(['contents']),
|
|
246
|
+
},
|
|
247
|
+
group: {
|
|
248
|
+
children: (0, primitives_1.listOf)(exports.loot_entry),
|
|
249
|
+
},
|
|
250
|
+
item: {
|
|
251
|
+
name: (0, primitives_1.resource)('item'),
|
|
252
|
+
},
|
|
253
|
+
loot_table: {
|
|
254
|
+
name: (0, primitives_1.resource)('loot_table'),
|
|
255
|
+
},
|
|
256
|
+
sequence: {
|
|
257
|
+
children: (0, primitives_1.listOf)(exports.loot_entry),
|
|
258
|
+
},
|
|
259
|
+
tag: {
|
|
260
|
+
name: (0, primitives_1.resource)('tag/item'),
|
|
261
|
+
expand: primitives_1.boolean,
|
|
262
|
+
},
|
|
263
|
+
}),
|
|
264
|
+
functions: (0, primitives_1.opt)((0, primitives_1.listOf)(exports.item_modifier), []),
|
|
265
|
+
conditions: (0, primitives_1.opt)((0, primitives_1.listOf)(exports.predicate), []),
|
|
266
|
+
})));
|
|
267
|
+
exports.loot_pool = (0, primitives_1.as)('loot_pool', (0, primitives_1.record)({
|
|
268
|
+
rolls: common_1.number_provider,
|
|
269
|
+
bonus_rolls: (0, primitives_1.opt)(common_1.number_provider, 0),
|
|
270
|
+
entries: (0, primitives_1.listOf)(exports.loot_entry),
|
|
271
|
+
functions: (0, primitives_1.opt)((0, primitives_1.listOf)(exports.item_modifier), []),
|
|
272
|
+
conditions: (0, primitives_1.opt)((0, primitives_1.listOf)(exports.predicate), []),
|
|
273
|
+
}));
|
|
274
|
+
exports.loot_table = (0, primitives_1.as)('loot_table', (0, primitives_1.record)({
|
|
275
|
+
type: (0, primitives_1.opt)((0, primitives_1.resource)(loot_context_types)),
|
|
276
|
+
pools: (0, primitives_1.opt)((0, primitives_1.listOf)(exports.loot_pool), []),
|
|
277
|
+
functions: (0, primitives_1.opt)((0, primitives_1.listOf)(exports.item_modifier), []),
|
|
278
|
+
}));
|
|
279
|
+
//# sourceMappingURL=loot_table.js.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.recipe = void 0;
|
|
4
|
+
const primitives_1 = require("@spyglassmc/json/lib/checker/primitives");
|
|
5
|
+
const util_1 = require("../util");
|
|
6
|
+
const one_recipe_ingredient = (0, primitives_1.any)([
|
|
7
|
+
(0, primitives_1.record)({
|
|
8
|
+
item: (0, primitives_1.resource)('item'),
|
|
9
|
+
}),
|
|
10
|
+
(0, primitives_1.record)({
|
|
11
|
+
tag: (0, primitives_1.resource)('tag/item'),
|
|
12
|
+
}),
|
|
13
|
+
]);
|
|
14
|
+
const recipe_ingredient = (0, primitives_1.any)([
|
|
15
|
+
one_recipe_ingredient,
|
|
16
|
+
(0, primitives_1.listOf)(one_recipe_ingredient),
|
|
17
|
+
]);
|
|
18
|
+
const recipe_result = (0, primitives_1.record)({
|
|
19
|
+
item: (0, primitives_1.resource)('item'),
|
|
20
|
+
count: (0, primitives_1.opt)((0, primitives_1.intRange)(1, 64), 1),
|
|
21
|
+
});
|
|
22
|
+
exports.recipe = (0, primitives_1.as)('recipe', (0, primitives_1.dispatch)('type', (type, props) => (0, primitives_1.record)({
|
|
23
|
+
type: (0, primitives_1.resource)('recipe_serializer'),
|
|
24
|
+
group: (0, primitives_1.opt)(util_1.recipeGroup),
|
|
25
|
+
...(0, primitives_1.pick)(type, {
|
|
26
|
+
crafting_shaped: {
|
|
27
|
+
pattern: (0, primitives_1.listOf)(primitives_1.simpleString),
|
|
28
|
+
key: (0, primitives_1.object)((0, util_1.patternKeys)(props), () => recipe_ingredient),
|
|
29
|
+
result: recipe_result,
|
|
30
|
+
},
|
|
31
|
+
crafting_shapeless: {
|
|
32
|
+
ingredients: (0, primitives_1.listOf)(recipe_ingredient),
|
|
33
|
+
result: recipe_result,
|
|
34
|
+
},
|
|
35
|
+
stonecutting: {
|
|
36
|
+
ingredient: recipe_ingredient,
|
|
37
|
+
result: (0, primitives_1.resource)('item'),
|
|
38
|
+
count: primitives_1.int,
|
|
39
|
+
},
|
|
40
|
+
smithing: {
|
|
41
|
+
base: one_recipe_ingredient,
|
|
42
|
+
addition: one_recipe_ingredient,
|
|
43
|
+
result: recipe_result,
|
|
44
|
+
},
|
|
45
|
+
}),
|
|
46
|
+
...(0, primitives_1.when)(type, ['blasting', 'campfire_cooking', 'smelting', 'smoking'], {
|
|
47
|
+
ingredient: recipe_ingredient,
|
|
48
|
+
result: (0, primitives_1.resource)('item'),
|
|
49
|
+
experience: (0, primitives_1.opt)(primitives_1.float, 0),
|
|
50
|
+
cookingtime: (0, primitives_1.opt)(primitives_1.int, type === 'smelting' ? 200 : 100),
|
|
51
|
+
}),
|
|
52
|
+
})));
|
|
53
|
+
//# sourceMappingURL=recipe.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const rule_test: import("@spyglassmc/json/lib/checker").JsonChecker;
|
|
2
|
+
export declare const pos_rule_test: import("@spyglassmc/json/lib/checker").JsonChecker;
|
|
3
|
+
export declare const processor_list: import("@spyglassmc/json/lib/checker").JsonChecker;
|
|
4
|
+
export declare const processor_list_ref: import("@spyglassmc/json/lib/checker").JsonChecker;
|
|
5
|
+
export declare const template_pool: import("@spyglassmc/json/lib/checker").JsonChecker;
|
|
6
|
+
export declare const template_pool_ref: import("@spyglassmc/json/lib/checker").JsonChecker;
|
|
7
|
+
export declare const configured_structure_feature: import("@spyglassmc/json/lib/checker").JsonChecker;
|
|
8
|
+
//# sourceMappingURL=structure.d.ts.map
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configured_structure_feature = exports.template_pool_ref = exports.template_pool = exports.processor_list_ref = exports.processor_list = exports.pos_rule_test = exports.rule_test = void 0;
|
|
4
|
+
const checker_1 = require("@spyglassmc/json/lib/checker");
|
|
5
|
+
const util_1 = require("../util");
|
|
6
|
+
const common_1 = require("./common");
|
|
7
|
+
const feature_1 = require("./feature");
|
|
8
|
+
exports.rule_test = (0, checker_1.as)('rule_test', (0, checker_1.dispatch)('predicate_type', type => (0, checker_1.record)({
|
|
9
|
+
predicate_type: (0, checker_1.resource)('rule_test'),
|
|
10
|
+
...(0, checker_1.pick)(type, {
|
|
11
|
+
block_match: {
|
|
12
|
+
block: (0, checker_1.resource)('block'),
|
|
13
|
+
},
|
|
14
|
+
blockstate_match: {
|
|
15
|
+
block_state: common_1.block_state,
|
|
16
|
+
},
|
|
17
|
+
random_block_match: {
|
|
18
|
+
block: (0, checker_1.resource)('block'),
|
|
19
|
+
probability: (0, checker_1.floatRange)(0, 1),
|
|
20
|
+
},
|
|
21
|
+
random_blockstate_match: {
|
|
22
|
+
block_state: common_1.block_state,
|
|
23
|
+
probability: (0, checker_1.floatRange)(0, 1),
|
|
24
|
+
},
|
|
25
|
+
tag_match: {
|
|
26
|
+
tag: (0, checker_1.resource)('tag/block'),
|
|
27
|
+
},
|
|
28
|
+
}),
|
|
29
|
+
})));
|
|
30
|
+
exports.pos_rule_test = (0, checker_1.as)('pos_rule_test', (0, checker_1.dispatch)('predicate_type', type => (0, checker_1.record)({
|
|
31
|
+
predicate_type: (0, checker_1.resource)('pos_rule_test'),
|
|
32
|
+
...(0, checker_1.pick)(type, {
|
|
33
|
+
axis_aligned_linear_pos: {
|
|
34
|
+
axis: (0, checker_1.literal)(['x', 'y', 'z']),
|
|
35
|
+
min_dist: (0, checker_1.opt)((0, checker_1.intRange)(0, 255)),
|
|
36
|
+
max_dist: (0, checker_1.opt)((0, checker_1.intRange)(0, 255)),
|
|
37
|
+
min_chance: (0, checker_1.opt)((0, checker_1.floatRange)(0, 1)),
|
|
38
|
+
max_chance: (0, checker_1.opt)((0, checker_1.floatRange)(0, 1)),
|
|
39
|
+
},
|
|
40
|
+
}),
|
|
41
|
+
...(0, checker_1.when)(type, ['axis_aligned_linear_pos', 'linear_pos'], {}),
|
|
42
|
+
})));
|
|
43
|
+
const processor_rule = (0, checker_1.as)('processor_rule', (0, checker_1.dispatch)(props => (0, checker_1.record)({
|
|
44
|
+
position_predicate: (0, checker_1.opt)(exports.pos_rule_test, { predicate_type: 'always_true' }),
|
|
45
|
+
input_predicate: exports.rule_test,
|
|
46
|
+
location_predicate: exports.rule_test,
|
|
47
|
+
output_state: common_1.block_state,
|
|
48
|
+
output_nbt: (0, checker_1.opt)((0, util_1.nbt)({ registry: 'block', id: (0, checker_1.extractNested)('output_state', 'Name', props) })),
|
|
49
|
+
})));
|
|
50
|
+
const processor = (0, checker_1.as)('processor', (0, checker_1.dispatch)('processor_type', type => (0, checker_1.record)({
|
|
51
|
+
processor_type: (0, checker_1.resource)('worldgen/structure_processor'),
|
|
52
|
+
...(0, checker_1.pick)(type, {
|
|
53
|
+
block_age: {
|
|
54
|
+
mossiness: checker_1.float,
|
|
55
|
+
},
|
|
56
|
+
block_ignore: {
|
|
57
|
+
blocks: (0, checker_1.listOf)(common_1.block_state),
|
|
58
|
+
},
|
|
59
|
+
block_rot: {
|
|
60
|
+
integrity: (0, checker_1.floatRange)(0, 1),
|
|
61
|
+
},
|
|
62
|
+
gravity: {
|
|
63
|
+
heightmap: (0, checker_1.literal)(common_1.HeightmapType),
|
|
64
|
+
},
|
|
65
|
+
protected_blocks: {
|
|
66
|
+
value: (0, checker_1.resource)('tag/block'),
|
|
67
|
+
},
|
|
68
|
+
rule: {
|
|
69
|
+
rules: (0, checker_1.listOf)(processor_rule),
|
|
70
|
+
},
|
|
71
|
+
}),
|
|
72
|
+
})));
|
|
73
|
+
exports.processor_list = (0, checker_1.as)('processor_list', (0, checker_1.any)([
|
|
74
|
+
(0, checker_1.record)({
|
|
75
|
+
processors: (0, checker_1.listOf)(processor),
|
|
76
|
+
}),
|
|
77
|
+
(0, checker_1.listOf)(processor),
|
|
78
|
+
]));
|
|
79
|
+
exports.processor_list_ref = (0, checker_1.as)('processor_list', (0, checker_1.any)([
|
|
80
|
+
(0, checker_1.resource)('worldgen/processor_list'),
|
|
81
|
+
exports.processor_list,
|
|
82
|
+
]));
|
|
83
|
+
const template_element = (0, checker_1.as)('template_element', (0, checker_1.dispatch)('element_type', (type, _, ctx) => (0, checker_1.record)({
|
|
84
|
+
element_type: (0, checker_1.resource)('worldgen/structure_pool_element'),
|
|
85
|
+
...(0, checker_1.when)(type, ['empty_pool_element'], {}, {
|
|
86
|
+
projection: (0, checker_1.literal)(['rigid', 'terrain_matching']),
|
|
87
|
+
}),
|
|
88
|
+
...(0, checker_1.pick)(type, {
|
|
89
|
+
feature_pool_element: {
|
|
90
|
+
feature: (0, util_1.versioned)(ctx, feature_1.configured_feature_ref, '1.18', feature_1.placed_feature_ref),
|
|
91
|
+
},
|
|
92
|
+
legacy_single_pool_element: {
|
|
93
|
+
location: (0, checker_1.resource)('structure'),
|
|
94
|
+
processors: exports.processor_list_ref,
|
|
95
|
+
},
|
|
96
|
+
list_pool_element: {
|
|
97
|
+
elements: (0, checker_1.listOf)(template_element),
|
|
98
|
+
},
|
|
99
|
+
single_pool_element: {
|
|
100
|
+
location: (0, checker_1.resource)('structure'),
|
|
101
|
+
processors: exports.processor_list_ref,
|
|
102
|
+
},
|
|
103
|
+
}),
|
|
104
|
+
})));
|
|
105
|
+
exports.template_pool = (0, checker_1.as)('template_pool', (0, checker_1.record)({
|
|
106
|
+
name: checker_1.simpleString,
|
|
107
|
+
fallback: (0, checker_1.resource)('worldgen/template_pool'),
|
|
108
|
+
elements: (0, checker_1.listOf)((0, checker_1.record)({
|
|
109
|
+
weight: (0, checker_1.intRange)(1, undefined),
|
|
110
|
+
element: template_element,
|
|
111
|
+
})),
|
|
112
|
+
}));
|
|
113
|
+
exports.template_pool_ref = (0, checker_1.any)([
|
|
114
|
+
(0, checker_1.resource)('worldgen/template_pool'),
|
|
115
|
+
exports.template_pool,
|
|
116
|
+
]);
|
|
117
|
+
exports.configured_structure_feature = (0, checker_1.as)('structure_feature', (0, checker_1.dispatch)('type', type => (0, checker_1.record)({
|
|
118
|
+
type: (0, checker_1.resource)('worldgen/structure_feature'),
|
|
119
|
+
config: (0, checker_1.record)({
|
|
120
|
+
...(0, checker_1.when)(type, ['bastion_remnant', 'pillager_outpost', 'village'], {
|
|
121
|
+
start_pool: exports.template_pool_ref,
|
|
122
|
+
size: (0, checker_1.intRange)(0, 7),
|
|
123
|
+
}, (0, checker_1.pick)(type, {
|
|
124
|
+
buried_treasure: {
|
|
125
|
+
probability: (0, checker_1.floatRange)(0, 1),
|
|
126
|
+
},
|
|
127
|
+
mineshaft: {
|
|
128
|
+
type: (0, checker_1.literal)(['normal', 'mesa']),
|
|
129
|
+
probability: (0, checker_1.floatRange)(0, 1),
|
|
130
|
+
},
|
|
131
|
+
nether_fossil: {
|
|
132
|
+
height: common_1.height_provider,
|
|
133
|
+
},
|
|
134
|
+
ocean_ruin: {
|
|
135
|
+
biome_temp: (0, checker_1.literal)(['cold', 'warm']),
|
|
136
|
+
large_probability: (0, checker_1.floatRange)(0, 1),
|
|
137
|
+
cluster_probability: (0, checker_1.floatRange)(0, 1),
|
|
138
|
+
},
|
|
139
|
+
ruined_portal: {
|
|
140
|
+
portal_type: (0, checker_1.literal)(['standard', 'desert', 'jungle', 'mountain', 'nether', 'ocean', 'swamp']),
|
|
141
|
+
},
|
|
142
|
+
shipwreck: {
|
|
143
|
+
is_beached: (0, checker_1.opt)(checker_1.boolean, false),
|
|
144
|
+
},
|
|
145
|
+
})),
|
|
146
|
+
}),
|
|
147
|
+
})));
|
|
148
|
+
//# sourceMappingURL=structure.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const block_tag: import("@spyglassmc/json/lib/checker").JsonChecker;
|
|
2
|
+
export declare const entity_type_tag: import("@spyglassmc/json/lib/checker").JsonChecker;
|
|
3
|
+
export declare const fluid_tag: import("@spyglassmc/json/lib/checker").JsonChecker;
|
|
4
|
+
export declare const function_tag: import("@spyglassmc/json/lib/checker").JsonChecker;
|
|
5
|
+
export declare const game_event_tag: import("@spyglassmc/json/lib/checker").JsonChecker;
|
|
6
|
+
export declare const item_tag: import("@spyglassmc/json/lib/checker").JsonChecker;
|
|
7
|
+
//# sourceMappingURL=tag.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.item_tag = exports.game_event_tag = exports.function_tag = exports.fluid_tag = exports.entity_type_tag = exports.block_tag = void 0;
|
|
4
|
+
const core_1 = require("@spyglassmc/core");
|
|
5
|
+
const lib_1 = require("@spyglassmc/json/lib");
|
|
6
|
+
const primitives_1 = require("@spyglassmc/json/lib/checker/primitives");
|
|
7
|
+
const lib_2 = require("@spyglassmc/locales/lib");
|
|
8
|
+
const tag = (type) => (0, primitives_1.record)({
|
|
9
|
+
replace: (0, primitives_1.opt)(primitives_1.boolean, false),
|
|
10
|
+
values: (0, primitives_1.uniqueListOf)((0, primitives_1.any)([
|
|
11
|
+
(0, primitives_1.resource)(type, true),
|
|
12
|
+
(0, primitives_1.record)({
|
|
13
|
+
id: (0, primitives_1.resource)(type, true),
|
|
14
|
+
required: (0, primitives_1.opt)(primitives_1.boolean, true),
|
|
15
|
+
}),
|
|
16
|
+
]), {
|
|
17
|
+
items: (node) => {
|
|
18
|
+
if (lib_1.JsonStringNode.is(node)) {
|
|
19
|
+
return [core_1.ResourceLocation.shorten(node.value), node];
|
|
20
|
+
}
|
|
21
|
+
if (lib_1.JsonObjectNode.is(node)) {
|
|
22
|
+
const id = node.children.find(c => c.key?.value === 'id');
|
|
23
|
+
if (id && id.value && lib_1.JsonStringNode.is(id.value)) {
|
|
24
|
+
return [core_1.ResourceLocation.shorten(id.value.value), id.value];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return [undefined, node];
|
|
28
|
+
},
|
|
29
|
+
report: (node, ctx) => ctx.err.report((0, lib_2.localize)('json.checker.tag-entry.duplicate'), node, 2 /* Warning */),
|
|
30
|
+
}),
|
|
31
|
+
});
|
|
32
|
+
exports.block_tag = tag('block');
|
|
33
|
+
exports.entity_type_tag = tag('entity_type');
|
|
34
|
+
exports.fluid_tag = tag('fluid');
|
|
35
|
+
exports.function_tag = tag('function');
|
|
36
|
+
exports.game_event_tag = tag('game_event');
|
|
37
|
+
exports.item_tag = tag('item');
|
|
38
|
+
//# sourceMappingURL=tag.js.map
|