Skip to content

Add VERSIONS WOOHOO#9

Merged
SpyC0der77 merged 2 commits into
mainfrom
add-versions
Jun 5, 2026
Merged

Add VERSIONS WOOHOO#9
SpyC0der77 merged 2 commits into
mainfrom
add-versions

Conversation

@SpyC0der77

@SpyC0der77 SpyC0der77 commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for Minecraft versions 1.21.4, 1.21.5, 1.21.6, 1.21.7-8, 1.21.9-10, and 26.1.
    • Enhanced version profile handling with improved template selection based on configuration.
  • Improvements

    • Refined text component serialization with version-specific click and hover event formatting.
    • Expanded supported versions index for easier version discovery.
  • Tests

    • Added comprehensive test suite for version profile validation and datapack generation.

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@SpyC0der77, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 36 minutes and 36 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9b7f03a9-db38-493e-ba7a-57de4e227ef0

📥 Commits

Reviewing files that changed from the base of the PR and between bb94370 and e2a11e3.

📒 Files selected for processing (6)
  • minecraft_script/version_config.py
  • minecraft_script/versions/1.21.11.json
  • minecraft_script/versions/1.21.9-10.json
  • minecraft_script/versions/26.1.json
  • minecraft_script/versions/index.json
  • tests/test_version_profiles.py
📝 Walkthrough

Walkthrough

The PR extends the Minecraft-Script compiler to support multiple Minecraft versions with version-specific text component serialization. It adds version-stem-based profile resolution for range versions (e.g., 1.21.7-8), introduces configurable click/hover event keys, refactors tellraw logging to use serialized text components, defines six new version profiles, and validates the changes with comprehensive tests.

Changes

Multi-version profiles with configurable text component serialization

Layer / File(s) Summary
Version stem resolution and profile lookup
minecraft_script/version_config.py
Adds _expand_version_stem to expand hyphenated stems into patch ranges, introduces _profile_path_for_version to resolve profile JSON files by exact match or stem expansion, and updates list_supported_versions and predefined_root to use the new lookup logic.
Text component serialization configuration contract
minecraft_script/text_components.py
Extends get_text_component_config to include click_event_value_keys defaults (e.g., open_url, run_command, suggest_command) and merges version-specific overrides from orchestration.
Click and hover event methods with version-specific keys
minecraft_script/compiler/text_component_builtins.py
Updates _method_click to select payload keys from config for different actions and _method_hover_item to conditionally inline or nest hover values based on hover_event_show_item config.
Tellraw command generation using text component serialization
minecraft_script/compiler/builtin_functions.py
Refactors _direct_tellraw_log_commands to construct and serialize text components via the pipeline instead of manually concatenating JSON fragments.
Version profile definitions (1.21.4 through 26.1)
minecraft_script/versions/*.json, minecraft_script/versions/index.json
Adds six complete version profiles for 1.21.4, 1.21.5, 1.21.6, 1.21.7-8, 1.21.9-10, and 26.1, each defining templates, orchestration settings, breaking changes, and template assemblies. Updates index.json to list all supported versions.
Version profile and text component tests
tests/test_version_profiles.py
Validates version profile resolution, pack metadata formatting differences (legacy pack_format vs. range min_format/max_format), SNBT text component serialization for 1.21.5, and compile output for 1.21.5 and 1.21.9.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • SpyC0der77/Minecraft-Script#3: Introduces the version-profile infrastructure and text-component serialization pipeline that this PR extends with click/hover key configuration and multiple version support.

Poem

🐰 Across the versions, stems expand with care,
New profiles rise for each Minecraft square,
Click keys cascade through config streams,
Tellraw serialized in version-dreams—
From 1.21.4 to 26.1's gleam!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Add VERSIONS WOOHOO' is vague and does not meaningfully convey what versions are being added or the purpose of the changes. Revise the title to be more descriptive, such as 'Add support for Minecraft versions 1.21.4-1.21.11 and 26.1' to clearly indicate the main changes.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-versions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
minecraft_script/versions/1.21.9-10.json (1)

4-4: Legacy pack.mcmeta template won’t be emitted for range-format profiles.

minecraft_script/version_config.py selects the pack metadata template from orchestration["pack"]["format"].style: when it is "range", render_pack_mcmeta() renders pack.mcmeta.range; otherwise it renders the legacy pack.mcmeta. The existing version-profile test expects range output (min_format/max_format == [88, 0] and no pack_format), matching pack.mcmeta.range, so the hardcoded supported_formats: [81, 81] in minecraft_script/versions/1.21.9-10.json is not functionally used for the range case.

Optional: remove or align the unused legacy pack.mcmeta blocks across the range profiles to avoid confusion.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@minecraft_script/versions/1.21.9-10.json` at line 4, The legacy pack.mcmeta
block in the JSON is misleading for profiles using range-style pack metadata;
update the range-format profiles so they don't include a hardcoded legacy
"pack.mcmeta" template (or align it with the range semantics). Locate where
orchestration["pack"]["format"].style is expected to be "range" and where
render_pack_mcmeta() selects pack.mcmeta.range vs pack.mcmeta, then remove or
replace the legacy "pack.mcmeta" entry in versions like the 1.21.9-10 profile so
the file either omits the legacy template or matches the range-format output (no
pack_format and using min_format/max_format) to avoid confusion with
pack.mcmeta.range.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@minecraft_script/versions/1.21.9-10.json`:
- Line 4: The legacy pack.mcmeta block in the JSON is misleading for profiles
using range-style pack metadata; update the range-format profiles so they don't
include a hardcoded legacy "pack.mcmeta" template (or align it with the range
semantics). Locate where orchestration["pack"]["format"].style is expected to be
"range" and where render_pack_mcmeta() selects pack.mcmeta.range vs pack.mcmeta,
then remove or replace the legacy "pack.mcmeta" entry in versions like the
1.21.9-10 profile so the file either omits the legacy template or matches the
range-format output (no pack_format and using min_format/max_format) to avoid
confusion with pack.mcmeta.range.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a47e1ad9-e76b-415c-b9ac-f1f14c287a31

📥 Commits

Reviewing files that changed from the base of the PR and between 2cabec3 and bb94370.

📒 Files selected for processing (13)
  • minecraft_script/compiler/builtin_functions.py
  • minecraft_script/compiler/text_component_builtins.py
  • minecraft_script/text_components.py
  • minecraft_script/version_config.py
  • minecraft_script/versions/1.21.11.json
  • minecraft_script/versions/1.21.4.json
  • minecraft_script/versions/1.21.5.json
  • minecraft_script/versions/1.21.6.json
  • minecraft_script/versions/1.21.7-8.json
  • minecraft_script/versions/1.21.9-10.json
  • minecraft_script/versions/26.1.json
  • minecraft_script/versions/index.json
  • tests/test_version_profiles.py

- Replaced the version expansion logic with a new method to load version profiles from an index file, improving maintainability.
- Updated the `pack.mcmeta` template format to use `min_format` and `max_format` instead of `pack_format` and `supported_formats` for better compatibility with version ranges.
- Added new profiles to the version index for better version management and support in the Minecraft-Script environment.
@SpyC0der77

Copy link
Copy Markdown
Owner Author

@cursor review

@SpyC0der77 SpyC0der77 merged commit 6cb931a into main Jun 5, 2026
2 checks passed
@SpyC0der77 SpyC0der77 deleted the add-versions branch June 5, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant