fix: replace PatternType.getByIdentifier() with PatternTypeProvider#6553
fix: replace PatternType.getByIdentifier() with PatternTypeProvider#65531wairesd wants to merge 1 commit into
Conversation
PatternType.getByIdentifier() causes IncompatibleClassChangeError on 1.19.4 due to a mismatch between Methodref and InterfaceMethodref bytecode constants when compiled against a newer API. Introduce PatternTypeProvider with two implementations: - LegacyPatternTypeProvider: iterates PatternType.values() for 1.19.4 and older where PatternType is still an enum - ModernPatternTypeProvider: uses Registry.BANNER_PATTERN for 1.20.5+ Update MetaItemStack.addBannerMeta to resolve PatternType through the provider instead of calling the deprecated static method directly.
|
Here's the PR template you ignored. https://github.com/EssentialsX/Essentials/blob/2.x/.github/PULL_REQUEST_TEMPLATE/bug-fix.md |
|
Information Details The fix introduces a PatternTypeProvider interface with two implementations selected at runtime via the existing provider system: LegacyPatternTypeProvider (weight 0) — iterates PatternType.values() and compares identifiers; works on 1.19.4 and older where PatternType is still an enum. Environments tested: OS: Windows 10, Ubuntu 22.04 Java version: 21 Most recent Paper version (1.19.4, git-Paper-550) Before (1.19.4): [ERROR]: Command kit failed: java.lang.IncompatibleClassChangeError: Method |
PatternType.getByIdentifier() causes IncompatibleClassChangeError on 1.19.4 due to a mismatch between Methodref and InterfaceMethodref bytecode constants when compiled against a newer API.
Introduce PatternTypeProvider with two implementations:
Update MetaItemStack.addBannerMeta to resolve PatternType through the provider instead of calling the deprecated static method directly.
You need to select a pull request template!
If you're adding a new feature, copy and paste the following parameter at the end of the URL:
?template=new-feature.md
If you're fixing a bug, copy and paste the following parameter at the end of the URL:
?template=bug-fix.md
For more information about contributing to EssentialsX, see CONTRIBUTING.md:
https://github.com/EssentialsX/Essentials/blob/2.x/CONTRIBUTING.md