@spyglassmc/java-edition 0.3.46 → 0.3.48

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.
@@ -17,7 +17,7 @@ export declare function dissectUri(uri: string, ctx: UriBinderContext): {
17
17
  namespace: string;
18
18
  identifier: string;
19
19
  path: string;
20
- category: "function" | "advancement" | "banner_pattern" | "cat_variant" | "chat_type" | "chicken_variant" | "cow_variant" | "damage_type" | "dialog" | "dimension" | "dimension_type" | "enchantment" | "enchantment_provider" | "frog_variant" | "instrument" | "item_modifier" | "jukebox_song" | "loot_table" | "painting_variant" | "pig_variant" | "predicate" | "recipe" | "structure" | "test_environment" | "test_instance" | "trial_spawner" | "trim_material" | "trim_pattern" | "wolf_sound_variant" | "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/chunk_status" | "tag/command_argument_type" | "tag/consume_effect_type" | "tag/creative_mode_tab" | "tag/custom_stat" | "tag/data_component_predicate_type" | "tag/data_component_type" | "tag/debug_subscription" | "tag/decorated_pot_pattern" | "tag/decorated_pot_patterns" | "tag/dialog_action_type" | "tag/dialog_body_type" | "tag/dialog_type" | "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/game_event" | "tag/height_provider_type" | "tag/incoming_rpc_methods" | "tag/input_control_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/outgoing_rpc_methods" | "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/spawn_condition_type" | "tag/stat_type" | "tag/test_environment_definition_type" | "tag/test_function" | "tag/test_instance_type" | "tag/trigger_type" | "tag/ticket_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/cat_variant" | "tag/chat_type" | "tag/chicken_variant" | "tag/cow_variant" | "tag/damage_type" | "tag/dialog" | "tag/dimension" | "tag/dimension_type" | "tag/enchantment" | "tag/enchantment_provider" | "tag/frog_variant" | "tag/item_modifier" | "tag/jukebox_song" | "tag/loot_table" | "tag/painting_variant" | "tag/pig_variant" | "tag/predicate" | "tag/recipe" | "tag/structure" | "tag/test_environment" | "tag/test_instance" | "tag/trial_spawner" | "tag/trim_material" | "tag/trim_pattern" | "tag/wolf_sound_variant" | "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" | "waypoint_style";
20
+ category: "function" | "advancement" | "banner_pattern" | "cat_variant" | "chat_type" | "chicken_variant" | "cow_variant" | "damage_type" | "dialog" | "dimension" | "dimension_type" | "enchantment" | "enchantment_provider" | "frog_variant" | "instrument" | "item_modifier" | "jukebox_song" | "loot_table" | "painting_variant" | "pig_variant" | "predicate" | "recipe" | "structure" | "test_environment" | "test_instance" | "trial_spawner" | "trim_material" | "trim_pattern" | "wolf_sound_variant" | "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/chunk_status" | "tag/command_argument_type" | "tag/consume_effect_type" | "tag/creative_mode_tab" | "tag/custom_stat" | "tag/data_component_predicate_type" | "tag/data_component_type" | "tag/debug_subscription" | "tag/decorated_pot_pattern" | "tag/decorated_pot_patterns" | "tag/dialog_action_type" | "tag/dialog_body_type" | "tag/dialog_type" | "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/game_event" | "tag/height_provider_type" | "tag/incoming_rpc_methods" | "tag/input_control_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/outgoing_rpc_methods" | "tag/particle_type" | "tag/permission_check_type" | "tag/permission_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/spawn_condition_type" | "tag/stat_type" | "tag/test_environment_definition_type" | "tag/test_function" | "tag/test_instance_type" | "tag/trigger_type" | "tag/ticket_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/cat_variant" | "tag/chat_type" | "tag/chicken_variant" | "tag/cow_variant" | "tag/damage_type" | "tag/dialog" | "tag/dimension" | "tag/dimension_type" | "tag/enchantment" | "tag/enchantment_provider" | "tag/frog_variant" | "tag/item_modifier" | "tag/jukebox_song" | "tag/loot_table" | "tag/painting_variant" | "tag/pig_variant" | "tag/predicate" | "tag/recipe" | "tag/structure" | "tag/test_environment" | "tag/test_instance" | "tag/trial_spawner" | "tag/trim_material" | "tag/trim_pattern" | "tag/wolf_sound_variant" | "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" | "waypoint_style";
21
21
  ext: `.${string}`;
22
22
  pack: "assets" | "data";
23
23
  since?: `1.${number}` | undefined;
@@ -7,7 +7,12 @@ export var ReleaseVersion;
7
7
  * * `1` if `a` is newer than `b`.
8
8
  */
9
9
  function cmp(a, b) {
10
- return Math.sign(Number(a.slice(2)) - Number(b.slice(2)));
10
+ const [minorA, patchA = 0] = a.slice(2).split('.');
11
+ const [minorB, patchB = 0] = b.slice(2).split('.');
12
+ if (minorA !== minorB) {
13
+ return Math.sign(Number(minorA) - Number(minorB));
14
+ }
15
+ return Math.sign(Number(patchA) - Number(patchB));
11
16
  }
12
17
  ReleaseVersion.cmp = cmp;
13
18
  /**
@@ -1,7 +1,7 @@
1
1
  import * as core from '@spyglassmc/core';
2
2
  import type { PackInfo, VersionInfo } from './common.js';
3
3
  import { ReleaseVersion } from './common.js';
4
- export declare const NEXT_RELEASE_VERSION = "1.21.9";
4
+ export declare const NEXT_RELEASE_VERSION = "1.21.11";
5
5
  /**
6
6
  * @param inputVersion {@link core.Config.env.gameVersion}
7
7
  */
@@ -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.9';
4
+ export const NEXT_RELEASE_VERSION = '1.21.11';
5
5
  /**
6
6
  * @param inputVersion {@link core.Config.env.gameVersion}
7
7
  */
@@ -268,7 +268,7 @@ function nbtPathChecker(dispatchedBy) {
268
268
  const particle = (node, ctx) => {
269
269
  const id = core.ResourceLocationNode.toString(node.id, 'short');
270
270
  const release = ctx.project['loadedVersion'];
271
- if (release && ReleaseVersion.cmp(release, '1.20.5') < 0) {
271
+ if (!release || ReleaseVersion.cmp(release, '1.20.5') < 0) {
272
272
  return;
273
273
  }
274
274
  const options = node.children?.find(nbt.NbtCompoundNode.is);
@@ -277,7 +277,7 @@ const particle = (node, ctx) => {
277
277
  // run the type checker anyways to allow an empty compound
278
278
  nbt.checker.index('minecraft:particle', core.ResourceLocation.lengthen(id))(options, ctx);
279
279
  }
280
- else if (ParticleNode.requiresOptions(id)) {
280
+ else if (ParticleNode.requiresOptions(id, release)) {
281
281
  ctx.err.report(localize('expected', localize('nbt.node.compound')), core.Range.create(node.id.range.end, node.id.range.end + 1));
282
282
  }
283
283
  };
@@ -1,5 +1,6 @@
1
1
  import * as core from '@spyglassmc/core';
2
2
  import type * as nbt from '@spyglassmc/nbt';
3
+ import { ReleaseVersion } from '../../dependency/common.js';
3
4
  import type { NbtParserProperties } from '../tree/argument.js';
4
5
  export interface BlockStatesNode extends core.RecordBaseNode<core.StringNode, core.StringNode> {
5
6
  type: 'mcfunction:block/states';
@@ -252,7 +253,7 @@ export interface ObjectiveCriteriaNode extends core.AstNode {
252
253
  }
253
254
  export declare namespace ObjectiveCriteriaNode {
254
255
  const SimpleValues: string[];
255
- const ComplexCategories: Map<string, "block" | "fluid" | "instrument" | "activity" | "armor_material" | "attribute" | "block_entity_type" | "block_predicate_type" | "block_type" | "chunk_status" | "command_argument_type" | "consume_effect_type" | "creative_mode_tab" | "custom_stat" | "data_component_predicate_type" | "data_component_type" | "debug_subscription" | "decorated_pot_pattern" | "decorated_pot_patterns" | "dialog_action_type" | "dialog_body_type" | "dialog_type" | "enchantment_effect_component_type" | "enchantment_entity_effect_type" | "enchantment_level_based_value_type" | "enchantment_location_based_effect_type" | "enchantment_provider_type" | "enchantment_value_effect_type" | "entity_sub_predicate_type" | "entity_type" | "float_provider_type" | "game_event" | "height_provider_type" | "incoming_rpc_methods" | "input_control_type" | "int_provider_type" | "item" | "item_sub_predicate_type" | "loot_condition_type" | "loot_function_type" | "loot_nbt_provider_type" | "loot_number_provider_type" | "loot_pool_entry_type" | "loot_score_provider_type" | "map_decoration_type" | "memory_module_type" | "menu" | "mob_effect" | "motive" | "number_format_type" | "outgoing_rpc_methods" | "particle_type" | "point_of_interest_type" | "pos_rule_test" | "position_source_type" | "potion" | "recipe_book_category" | "recipe_display" | "recipe_serializer" | "recipe_type" | "rule_block_entity_modifier" | "rule_test" | "schedule" | "sensor_type" | "slot_display" | "sound_event" | "spawn_condition_type" | "stat_type" | "test_environment_definition_type" | "test_function" | "test_instance_type" | "trigger_type" | "ticket_type" | "villager_profession" | "villager_type" | "worldgen/biome_source" | "worldgen/block_placer_type" | "worldgen/block_state_provider_type" | "worldgen/carver" | "worldgen/chunk_generator" | "worldgen/decorator" | "worldgen/density_function_type" | "worldgen/feature" | "worldgen/feature_size_type" | "worldgen/foliage_placer_type" | "worldgen/material_condition" | "worldgen/material_rule" | "worldgen/placement_modifier_type" | "worldgen/pool_alias_binding" | "worldgen/root_placer_type" | "worldgen/structure_feature" | "worldgen/structure_piece" | "worldgen/structure_placement" | "worldgen/structure_pool_element" | "worldgen/structure_processor" | "worldgen/structure_type" | "worldgen/surface_builder" | "worldgen/tree_decorator_type" | "worldgen/trunk_placer_type">;
256
+ const ComplexCategories: Map<string, "block" | "fluid" | "instrument" | "activity" | "armor_material" | "attribute" | "block_entity_type" | "block_predicate_type" | "block_type" | "chunk_status" | "command_argument_type" | "consume_effect_type" | "creative_mode_tab" | "custom_stat" | "data_component_predicate_type" | "data_component_type" | "debug_subscription" | "decorated_pot_pattern" | "decorated_pot_patterns" | "dialog_action_type" | "dialog_body_type" | "dialog_type" | "enchantment_effect_component_type" | "enchantment_entity_effect_type" | "enchantment_level_based_value_type" | "enchantment_location_based_effect_type" | "enchantment_provider_type" | "enchantment_value_effect_type" | "entity_sub_predicate_type" | "entity_type" | "float_provider_type" | "game_event" | "height_provider_type" | "incoming_rpc_methods" | "input_control_type" | "int_provider_type" | "item" | "item_sub_predicate_type" | "loot_condition_type" | "loot_function_type" | "loot_nbt_provider_type" | "loot_number_provider_type" | "loot_pool_entry_type" | "loot_score_provider_type" | "map_decoration_type" | "memory_module_type" | "menu" | "mob_effect" | "motive" | "number_format_type" | "outgoing_rpc_methods" | "particle_type" | "permission_check_type" | "permission_type" | "point_of_interest_type" | "pos_rule_test" | "position_source_type" | "potion" | "recipe_book_category" | "recipe_display" | "recipe_serializer" | "recipe_type" | "rule_block_entity_modifier" | "rule_test" | "schedule" | "sensor_type" | "slot_display" | "sound_event" | "spawn_condition_type" | "stat_type" | "test_environment_definition_type" | "test_function" | "test_instance_type" | "trigger_type" | "ticket_type" | "villager_profession" | "villager_type" | "worldgen/biome_source" | "worldgen/block_placer_type" | "worldgen/block_state_provider_type" | "worldgen/carver" | "worldgen/chunk_generator" | "worldgen/decorator" | "worldgen/density_function_type" | "worldgen/feature" | "worldgen/feature_size_type" | "worldgen/foliage_placer_type" | "worldgen/material_condition" | "worldgen/material_rule" | "worldgen/placement_modifier_type" | "worldgen/pool_alias_binding" | "worldgen/root_placer_type" | "worldgen/structure_feature" | "worldgen/structure_piece" | "worldgen/structure_placement" | "worldgen/structure_pool_element" | "worldgen/structure_processor" | "worldgen/structure_type" | "worldgen/surface_builder" | "worldgen/tree_decorator_type" | "worldgen/trunk_placer_type">;
256
257
  const ComplexSep = ":";
257
258
  function mock(range: core.RangeLike): ObjectiveCriteriaNode;
258
259
  }
@@ -266,7 +267,7 @@ export declare namespace ParticleNode {
266
267
  export type SpecialType = typeof SpecialTypes extends Set<infer T> ? T : undefined;
267
268
  export function isSpecialType(type: string | undefined): type is SpecialType;
268
269
  export type OptionType = typeof SpecialTypes extends Set<infer T> ? T : undefined;
269
- export function requiresOptions(type: string | undefined): type is OptionType;
270
+ export function requiresOptions(type: string | undefined, release: ReleaseVersion): type is OptionType;
270
271
  export function is(node: core.AstNode | undefined): node is ParticleNode;
271
272
  export function mock(range: core.RangeLike): ParticleNode;
272
273
  export {};
@@ -346,7 +346,10 @@ export var ParticleNode;
346
346
  'entity_effect',
347
347
  'trail',
348
348
  ]);
349
- function requiresOptions(type) {
349
+ function requiresOptions(type, release) {
350
+ if (type === 'flash' && ReleaseVersion.cmp(release, '1.21.9') >= 0) {
351
+ return true;
352
+ }
350
353
  return OptionTypes.has(type);
351
354
  }
352
355
  ParticleNode.requiresOptions = requiresOptions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spyglassmc/java-edition",
3
- "version": "0.3.46",
3
+ "version": "0.3.48",
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.35",
21
- "@spyglassmc/json": "0.3.39",
20
+ "@spyglassmc/core": "0.4.36",
21
+ "@spyglassmc/json": "0.3.40",
22
22
  "@spyglassmc/locales": "0.3.19",
23
- "@spyglassmc/mcfunction": "0.2.38",
24
- "@spyglassmc/mcdoc": "0.3.39",
25
- "@spyglassmc/nbt": "0.3.40"
23
+ "@spyglassmc/mcfunction": "0.2.39",
24
+ "@spyglassmc/mcdoc": "0.3.40",
25
+ "@spyglassmc/nbt": "0.3.42"
26
26
  },
27
27
  "devDependencies": {},
28
28
  "publishConfig": {