@spyglassmc/java-edition 0.3.27 → 0.3.28
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 +1 -0
- package/lib/dependency/mcmeta.d.ts +1 -1
- package/lib/dependency/mcmeta.js +1 -1
- package/lib/mcfunction/checker/index.js +3 -0
- package/lib/mcfunction/parser/argument.d.ts +3 -0
- package/lib/mcfunction/parser/argument.js +22 -5
- package/package.json +6 -6
package/lib/binder/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare function dissectUri(uri: string, ctx: UriBinderContext): {
|
|
|
17
17
|
identifier: string;
|
|
18
18
|
expected: string | undefined;
|
|
19
19
|
path: string;
|
|
20
|
-
category: "function" | "advancement" | "banner_pattern" | "chat_type" | "damage_type" | "dimension" | "dimension_type" | "enchantment" | "enchantment_provider" | "instrument" | "item_modifier" | "jukebox_song" | "loot_table" | "painting_variant" | "predicate" | "recipe" | "structure" | "trial_spawner" | "trim_material" | "trim_pattern" | "wolf_variant" | "tag/function" | "tag/activity" | "tag/armor_material" | "tag/attribute" | "tag/block" | "tag/block_entity_type" | "tag/block_predicate_type" | "tag/block_type" | "tag/cat_variant" | "tag/chunk_status" | "tag/command_argument_type" | "tag/consume_effect_type" | "tag/creative_mode_tab" | "tag/custom_stat" | "tag/data_component_type" | "tag/decorated_pot_pattern" | "tag/decorated_pot_patterns" | "tag/enchantment_effect_component_type" | "tag/enchantment_entity_effect_type" | "tag/enchantment_level_based_value_type" | "tag/enchantment_location_based_effect_type" | "tag/enchantment_provider_type" | "tag/enchantment_value_effect_type" | "tag/entity_sub_predicate_type" | "tag/entity_type" | "tag/float_provider_type" | "tag/fluid" | "tag/frog_variant" | "tag/game_event" | "tag/height_provider_type" | "tag/instrument" | "tag/int_provider_type" | "tag/item" | "tag/item_sub_predicate_type" | "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/map_decoration_type" | "tag/memory_module_type" | "tag/menu" | "tag/mob_effect" | "tag/motive" | "tag/number_format_type" | "tag/particle_type" | "tag/point_of_interest_type" | "tag/pos_rule_test" | "tag/position_source_type" | "tag/potion" | "tag/recipe_book_category" | "tag/recipe_display" | "tag/recipe_serializer" | "tag/recipe_type" | "tag/rule_block_entity_modifier" | "tag/rule_test" | "tag/schedule" | "tag/sensor_type" | "tag/slot_display" | "tag/sound_event" | "tag/stat_type" | "tag/trigger_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/density_function_type" | "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/pool_alias_binding" | "tag/worldgen/root_placer_type" | "tag/worldgen/structure_feature" | "tag/worldgen/structure_piece" | "tag/worldgen/structure_placement" | "tag/worldgen/structure_pool_element" | "tag/worldgen/structure_processor" | "tag/worldgen/structure_type" | "tag/worldgen/surface_builder" | "tag/worldgen/tree_decorator_type" | "tag/worldgen/trunk_placer_type" | "tag/advancement" | "tag/banner_pattern" | "tag/chat_type" | "tag/damage_type" | "tag/dimension" | "tag/dimension_type" | "tag/enchantment" | "tag/enchantment_provider" | "tag/item_modifier" | "tag/jukebox_song" | "tag/loot_table" | "tag/painting_variant" | "tag/predicate" | "tag/recipe" | "tag/structure" | "tag/trial_spawner" | "tag/trim_material" | "tag/trim_pattern" | "tag/wolf_variant" | "tag/worldgen/biome" | "tag/worldgen/configured_carver" | "tag/worldgen/configured_feature" | "tag/worldgen/configured_structure_feature" | "tag/worldgen/configured_surface_builder" | "tag/worldgen/density_function" | "tag/worldgen/flat_level_generator_preset" | "tag/worldgen/multi_noise_biome_source_parameter_list" | "tag/worldgen/noise" | "tag/worldgen/noise_settings" | "tag/worldgen/placed_feature" | "tag/worldgen/processor_list" | "tag/worldgen/structure" | "tag/worldgen/structure_set" | "tag/worldgen/template_pool" | "tag/worldgen/world_preset" | "worldgen/biome" | "worldgen/configured_carver" | "worldgen/configured_feature" | "worldgen/configured_structure_feature" | "worldgen/configured_surface_builder" | "worldgen/density_function" | "worldgen/flat_level_generator_preset" | "worldgen/multi_noise_biome_source_parameter_list" | "worldgen/noise" | "worldgen/noise_settings" | "worldgen/placed_feature" | "worldgen/processor_list" | "worldgen/structure" | "worldgen/structure_set" | "worldgen/template_pool" | "worldgen/world_preset" | "atlas" | "block_definition" | "equipment" | "font" | "font/ttf" | "font/otf" | "font/unihex" | "gpu_warnlist" | "item_definition" | "lang" | "lang/deprecated" | "model" | "particle" | "post_effect" | "regional_compliancies" | "shader" | "shader/fragment" | "shader/vertex" | "sound" | "sounds" | "texture" | "texture_meta";
|
|
20
|
+
category: "function" | "advancement" | "banner_pattern" | "chat_type" | "damage_type" | "dimension" | "dimension_type" | "enchantment" | "enchantment_provider" | "instrument" | "item_modifier" | "jukebox_song" | "loot_table" | "painting_variant" | "pig_variant" | "predicate" | "recipe" | "structure" | "trial_spawner" | "trim_material" | "trim_pattern" | "wolf_variant" | "tag/function" | "tag/activity" | "tag/armor_material" | "tag/attribute" | "tag/block" | "tag/block_entity_type" | "tag/block_predicate_type" | "tag/block_type" | "tag/cat_variant" | "tag/chunk_status" | "tag/command_argument_type" | "tag/consume_effect_type" | "tag/creative_mode_tab" | "tag/custom_stat" | "tag/data_component_type" | "tag/decorated_pot_pattern" | "tag/decorated_pot_patterns" | "tag/enchantment_effect_component_type" | "tag/enchantment_entity_effect_type" | "tag/enchantment_level_based_value_type" | "tag/enchantment_location_based_effect_type" | "tag/enchantment_provider_type" | "tag/enchantment_value_effect_type" | "tag/entity_sub_predicate_type" | "tag/entity_type" | "tag/float_provider_type" | "tag/fluid" | "tag/frog_variant" | "tag/game_event" | "tag/height_provider_type" | "tag/instrument" | "tag/int_provider_type" | "tag/item" | "tag/item_sub_predicate_type" | "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/map_decoration_type" | "tag/memory_module_type" | "tag/menu" | "tag/mob_effect" | "tag/motive" | "tag/number_format_type" | "tag/particle_type" | "tag/point_of_interest_type" | "tag/pos_rule_test" | "tag/position_source_type" | "tag/potion" | "tag/recipe_book_category" | "tag/recipe_display" | "tag/recipe_serializer" | "tag/recipe_type" | "tag/rule_block_entity_modifier" | "tag/rule_test" | "tag/schedule" | "tag/sensor_type" | "tag/slot_display" | "tag/sound_event" | "tag/stat_type" | "tag/trigger_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/density_function_type" | "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/pool_alias_binding" | "tag/worldgen/root_placer_type" | "tag/worldgen/structure_feature" | "tag/worldgen/structure_piece" | "tag/worldgen/structure_placement" | "tag/worldgen/structure_pool_element" | "tag/worldgen/structure_processor" | "tag/worldgen/structure_type" | "tag/worldgen/surface_builder" | "tag/worldgen/tree_decorator_type" | "tag/worldgen/trunk_placer_type" | "tag/advancement" | "tag/banner_pattern" | "tag/chat_type" | "tag/damage_type" | "tag/dimension" | "tag/dimension_type" | "tag/enchantment" | "tag/enchantment_provider" | "tag/item_modifier" | "tag/jukebox_song" | "tag/loot_table" | "tag/painting_variant" | "tag/pig_variant" | "tag/predicate" | "tag/recipe" | "tag/structure" | "tag/trial_spawner" | "tag/trim_material" | "tag/trim_pattern" | "tag/wolf_variant" | "tag/worldgen/biome" | "tag/worldgen/configured_carver" | "tag/worldgen/configured_feature" | "tag/worldgen/configured_structure_feature" | "tag/worldgen/configured_surface_builder" | "tag/worldgen/density_function" | "tag/worldgen/flat_level_generator_preset" | "tag/worldgen/multi_noise_biome_source_parameter_list" | "tag/worldgen/noise" | "tag/worldgen/noise_settings" | "tag/worldgen/placed_feature" | "tag/worldgen/processor_list" | "tag/worldgen/structure" | "tag/worldgen/structure_set" | "tag/worldgen/template_pool" | "tag/worldgen/world_preset" | "worldgen/biome" | "worldgen/configured_carver" | "worldgen/configured_feature" | "worldgen/configured_structure_feature" | "worldgen/configured_surface_builder" | "worldgen/density_function" | "worldgen/flat_level_generator_preset" | "worldgen/multi_noise_biome_source_parameter_list" | "worldgen/noise" | "worldgen/noise_settings" | "worldgen/placed_feature" | "worldgen/processor_list" | "worldgen/structure" | "worldgen/structure_set" | "worldgen/template_pool" | "worldgen/world_preset" | "atlas" | "block_definition" | "equipment" | "font" | "font/ttf" | "font/otf" | "font/unihex" | "gpu_warnlist" | "item_definition" | "lang" | "lang/deprecated" | "model" | "particle" | "post_effect" | "regional_compliancies" | "shader" | "shader/fragment" | "shader/vertex" | "sound" | "sounds" | "texture" | "texture_meta";
|
|
21
21
|
ext: `.${string}`;
|
|
22
22
|
pack: "assets" | "data";
|
|
23
23
|
since?: `1.${number}` | undefined;
|
package/lib/binder/index.js
CHANGED
|
@@ -52,6 +52,7 @@ resource('enchantment_provider', { since: '1.21' });
|
|
|
52
52
|
resource('instrument', { since: '1.21.2' });
|
|
53
53
|
resource('jukebox_song', { since: '1.21' });
|
|
54
54
|
resource('painting_variant', { since: '1.21' });
|
|
55
|
+
resource('pig_variant', { since: '1.21.5' });
|
|
55
56
|
resource('trial_spawner', { since: '1.21.2' });
|
|
56
57
|
resource('trim_pattern', { since: '1.19.4' });
|
|
57
58
|
resource('trim_material', { since: '1.19.4' });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as core from '@spyglassmc/core';
|
|
2
2
|
import type { PackMcmeta, VersionInfo } from './common.js';
|
|
3
3
|
import { ReleaseVersion } from './common.js';
|
|
4
|
-
export declare const NEXT_RELEASE_VERSION = "1.21.
|
|
4
|
+
export declare const NEXT_RELEASE_VERSION = "1.21.5";
|
|
5
5
|
/**
|
|
6
6
|
* @param inputVersion {@link core.Config.env.gameVersion}
|
|
7
7
|
*/
|
package/lib/dependency/mcmeta.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as core from '@spyglassmc/core';
|
|
2
2
|
import { ReleaseVersion } from './common.js';
|
|
3
3
|
// DOCS: Update this when a new snapshot cycle begins
|
|
4
|
-
export const NEXT_RELEASE_VERSION = '1.21.
|
|
4
|
+
export const NEXT_RELEASE_VERSION = '1.21.5';
|
|
5
5
|
/**
|
|
6
6
|
* @param inputVersion {@link core.Config.env.gameVersion}
|
|
7
7
|
*/
|
|
@@ -51,6 +51,9 @@ const rootCommand = (nodes, index, ctx) => {
|
|
|
51
51
|
else if (json.TypedJsonNode.is(node)) {
|
|
52
52
|
json.checker.typed(node, ctx);
|
|
53
53
|
}
|
|
54
|
+
else if (nbt.TypedNbtNode.is(node)) {
|
|
55
|
+
nbt.checker.typed(node, ctx);
|
|
56
|
+
}
|
|
54
57
|
else if (NbtNode.is(node) && node.properties) {
|
|
55
58
|
const dispatchedBy = getEarlierNode(nodes, i, node.properties.dispatchedBy);
|
|
56
59
|
const indexedBy = getEarlierNode(nodes, i, node.properties.indexedBy);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as core from '@spyglassmc/core';
|
|
2
2
|
import * as json from '@spyglassmc/json';
|
|
3
3
|
import * as mcf from '@spyglassmc/mcfunction';
|
|
4
|
+
import * as nbt from '@spyglassmc/nbt';
|
|
4
5
|
import type { BlockNode, EntityNode, ParticleNode, ScoreHolderNode, UuidNode } from '../node/index.js';
|
|
5
6
|
import { EntitySelectorNode } from '../node/index.js';
|
|
6
7
|
/**
|
|
@@ -11,7 +12,9 @@ export declare const argument: mcf.ArgumentParserGetter;
|
|
|
11
12
|
export declare const blockPredicate: core.InfallibleParser<BlockNode>;
|
|
12
13
|
export declare function criterion(advancement: core.FullResourceLocation, usageType?: core.SymbolUsageType, terminators?: string[]): core.InfallibleParser<core.SymbolNode>;
|
|
13
14
|
export declare function entity(amount: 'multiple' | 'single', type: 'entities' | 'players'): core.Parser<EntityNode>;
|
|
15
|
+
export declare function typeRefParser(typeRef: `::${string}::${string}`): core.Parser<json.TypedJsonNode | nbt.TypedNbtNode>;
|
|
14
16
|
export declare function jsonParser(typeRef: `::${string}::${string}`): core.Parser<json.TypedJsonNode>;
|
|
17
|
+
export declare function nbtParser(typeRef: `::${string}::${string}`): core.Parser<nbt.TypedNbtNode>;
|
|
15
18
|
export declare const particle: core.InfallibleParser<ParticleNode>;
|
|
16
19
|
/**
|
|
17
20
|
* Failure when not beginning with `@[parse]`
|
|
@@ -87,7 +87,7 @@ export const argument = (rawTreeNode, prevNodes) => {
|
|
|
87
87
|
case 'minecraft:column_pos':
|
|
88
88
|
return wrap(vector({ dimension: 2, integersOnly: true }));
|
|
89
89
|
case 'minecraft:component':
|
|
90
|
-
return wrap(
|
|
90
|
+
return wrap(typeRefParser('::java::server::util::text::Text'));
|
|
91
91
|
case 'minecraft:dimension':
|
|
92
92
|
return wrap(core.resourceLocation({ category: 'dimension' }));
|
|
93
93
|
case 'minecraft:entity':
|
|
@@ -133,11 +133,11 @@ export const argument = (rawTreeNode, prevNodes) => {
|
|
|
133
133
|
case 'minecraft:mob_effect':
|
|
134
134
|
return wrap(core.resourceLocation({ category: 'mob_effect' }));
|
|
135
135
|
case 'minecraft:nbt_compound_tag':
|
|
136
|
-
return wrap(
|
|
136
|
+
return wrap(nbtDispatchedParser(nbt.parser.compound, treeNode.properties));
|
|
137
137
|
case 'minecraft:nbt_path':
|
|
138
138
|
return wrap(nbtPathParser(nbt.parser.path, treeNode.properties));
|
|
139
139
|
case 'minecraft:nbt_tag':
|
|
140
|
-
return wrap(
|
|
140
|
+
return wrap(nbtDispatchedParser(nbt.parser.entry, treeNode.properties));
|
|
141
141
|
case 'minecraft:objective':
|
|
142
142
|
return wrap(objective(core.SymbolUsageType.is(treeNode.properties?.usageType)
|
|
143
143
|
? treeNode.properties?.usageType
|
|
@@ -171,7 +171,7 @@ export const argument = (rawTreeNode, prevNodes) => {
|
|
|
171
171
|
return commandLiteral({ pool: getScoreboardSlotArgumentValues(ctx) })(src, ctx);
|
|
172
172
|
});
|
|
173
173
|
case 'minecraft:style':
|
|
174
|
-
return wrap(
|
|
174
|
+
return wrap(typeRefParser('::java::server::util::text::TextStyle'));
|
|
175
175
|
case 'minecraft:swizzle':
|
|
176
176
|
return wrap(commandLiteral({ pool: SwizzleArgumentValues }));
|
|
177
177
|
case 'minecraft:team':
|
|
@@ -358,6 +358,15 @@ const itemPredicate = (src, ctx) => {
|
|
|
358
358
|
return ans;
|
|
359
359
|
})(src, ctx);
|
|
360
360
|
};
|
|
361
|
+
export function typeRefParser(typeRef) {
|
|
362
|
+
return (src, ctx) => {
|
|
363
|
+
const release = ctx.project['loadedVersion'];
|
|
364
|
+
if (!release || ReleaseVersion.cmp(release, '1.21.5') < 0) {
|
|
365
|
+
return jsonParser(typeRef)(src, ctx);
|
|
366
|
+
}
|
|
367
|
+
return nbtParser(typeRef)(src, ctx);
|
|
368
|
+
};
|
|
369
|
+
}
|
|
361
370
|
export function jsonParser(typeRef) {
|
|
362
371
|
return core.map(json.parser.entry, (res) => ({
|
|
363
372
|
type: 'json:typed',
|
|
@@ -366,6 +375,14 @@ export function jsonParser(typeRef) {
|
|
|
366
375
|
targetType: { kind: 'reference', path: typeRef },
|
|
367
376
|
}));
|
|
368
377
|
}
|
|
378
|
+
export function nbtParser(typeRef) {
|
|
379
|
+
return core.map(nbt.parser.entry, (res) => ({
|
|
380
|
+
type: 'nbt:typed',
|
|
381
|
+
range: res.range,
|
|
382
|
+
children: [res],
|
|
383
|
+
targetType: { kind: 'reference', path: typeRef },
|
|
384
|
+
}));
|
|
385
|
+
}
|
|
369
386
|
function commandLiteral(options) {
|
|
370
387
|
return (src, ctx) => {
|
|
371
388
|
const ans = core.literal(options)(src, ctx);
|
|
@@ -392,7 +409,7 @@ const message = (src, ctx) => {
|
|
|
392
409
|
}
|
|
393
410
|
return ans;
|
|
394
411
|
};
|
|
395
|
-
function
|
|
412
|
+
function nbtDispatchedParser(parser, properties) {
|
|
396
413
|
return core.map(parser, (res) => {
|
|
397
414
|
const ans = { type: 'mcfunction:nbt', range: res.range, children: [res], properties };
|
|
398
415
|
return ans;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spyglassmc/java-edition",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.28",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
"release:dry": "npm publish --dry-run"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@spyglassmc/core": "0.4.
|
|
21
|
-
"@spyglassmc/json": "0.3.
|
|
20
|
+
"@spyglassmc/core": "0.4.22",
|
|
21
|
+
"@spyglassmc/json": "0.3.25",
|
|
22
22
|
"@spyglassmc/locales": "0.3.12",
|
|
23
|
-
"@spyglassmc/mcfunction": "0.2.
|
|
24
|
-
"@spyglassmc/mcdoc": "0.3.
|
|
25
|
-
"@spyglassmc/nbt": "0.3.
|
|
23
|
+
"@spyglassmc/mcfunction": "0.2.24",
|
|
24
|
+
"@spyglassmc/mcdoc": "0.3.26",
|
|
25
|
+
"@spyglassmc/nbt": "0.3.26"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {},
|
|
28
28
|
"publishConfig": {
|