Skip to content

fix: replace PatternType.getByIdentifier() with PatternTypeProvider#6553

Open
1wairesd wants to merge 1 commit into
EssentialsX:2.xfrom
1wairesd:2.x
Open

fix: replace PatternType.getByIdentifier() with PatternTypeProvider#6553
1wairesd wants to merge 1 commit into
EssentialsX:2.xfrom
1wairesd:2.x

Conversation

@1wairesd
Copy link
Copy Markdown
Contributor

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.

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

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.
@mbax
Copy link
Copy Markdown
Member

mbax commented May 31, 2026

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.

2 participants