Skip to content

Better 1.19.4 support#39

Merged
OstlerDev merged 3 commits intomasterfrom
fix-1-19-4
Aug 18, 2025
Merged

Better 1.19.4 support#39
OstlerDev merged 3 commits intomasterfrom
fix-1-19-4

Conversation

@OstlerDev
Copy link
Copy Markdown
Collaborator

@OstlerDev OstlerDev commented Aug 18, 2025

Fixes issues with 1.19.4 not having a few functions

Copilot Summary

This pull request updates how item and enchantment names are handled and displayed, improving compatibility across different Minecraft versions and ensuring proper translation support. The changes introduce new utility methods for enchantment translation, refactor legacy text component conversion, and enhance version checks for translation features.

Compatibility and Translation Improvements

  • Added isTranslationSupported() to MCVersion.java for centralized version checks to determine if translation keys are supported.
  • Updated item and enchantment name retrieval in ItemNameUtil.java to use translation keys when available, and provided a legacy fallback for older Minecraft versions.

Enchantment Name Handling

  • Introduced getEnchantmentTranslatable() and getEnchantmentName() in ItemNameUtil.java to support both modern and legacy enchantment name display, ensuring correct naming across versions.
  • Modified UtilMethods.getEnchantmentsComponent() to use the new enchantment translation method for displaying enchantments in item tooltips.

Text Component Conversion Refactor

  • Replaced direct use of TextComponent.fromLegacy() with a new utility method ShopMessage.componentFromLegacy() to handle differences between Minecraft versions, preventing errors on older versions.
  • Refactored all usages of legacy text conversion in ShopMessage.java to use the new componentFromLegacy() method for consistent behavior [1] [2] [3].

Minor Code Cleanup

  • Removed unused imports and legacy code from ItemNameUtil.java for better maintainability.
  • Changed getNameTranslatable() in ItemNameUtil.java to be static for easier access and consistency.

These changes collectively improve the reliability and user experience of item and enchantment name display, especially in environments with varying Minecraft versions.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Aug 18, 2025

Build Completed Successfully! 🎉

Version: 1.10.2-ee975e0
Diff Cover: View report

Download Build

⬇️ shop-1.10.2-ee975e0.jar

@github-actions
Copy link
Copy Markdown

github-actions bot commented Aug 18, 2025

Coverage Report

Overall Project 38.9% -0.43% 🟢
Files changed 8.76% 🔸

File Coverage
ShopMessage.java 64.96% -0.88% 🔸
MCVersion.java 60.98% 🟢
UtilMethods.java 28.05% -0.22% 🔸
ItemNameUtil.java 19.94% -37.95% 🔸

@OstlerDev
Copy link
Copy Markdown
Collaborator Author

Confirmed working during debug session with server owner

@OstlerDev OstlerDev merged commit 2fbc1c9 into master Aug 18, 2025
2 checks passed
@OstlerDev OstlerDev deleted the fix-1-19-4 branch August 18, 2025 01:06
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