Skip to content

Fix ArrayStoreException in BaseItemBuilder placeholder handling#3

Merged
DiamondDagger590 merged 1 commit into
DiamondDagger590:developfrom
dnocturne:fix/tag-resolver-array-type
Jan 18, 2026
Merged

Fix ArrayStoreException in BaseItemBuilder placeholder handling#3
DiamondDagger590 merged 1 commit into
DiamondDagger590:developfrom
dnocturne:fix/tag-resolver-array-type

Conversation

@dnocturne
Copy link
Copy Markdown
Contributor

@dnocturne dnocturne commented Jan 18, 2026

While doing DiamondDagger590/McRPG#194 I ran into this issue.

  • Fix ArrayStoreException when using PlaceholderAPI with GUI items

When a player with PlaceholderAPI installed opens a GUI (e.g., /mcrpg), an ArrayStoreException is thrown:

java.lang.ArrayStoreException: net.kyori.adventure.text.minimessage.tag.resolver.TagResolver$1 at BaseItemBuilder.getPlaceHolders(BaseItemBuilder.java:1115)

Cause

In getPlaceHolders(), the array is declared as TagResolver.Single[] but CorePapiHook.getTagResolver() returns a TagResolver (not TagResolver.Single). Java arrays are covariant but enforce runtime type checking, causing the store to fail.

Fix

Change the array instantiation from new TagResolver.Single[...] to new TagResolver[...]. Both TagResolver.Single and TagResolver can be stored in a TagResolver[] array.

@DiamondDagger590 DiamondDagger590 merged commit 74b91cb into DiamondDagger590:develop Jan 18, 2026
@dnocturne dnocturne deleted the fix/tag-resolver-array-type branch January 19, 2026 23:38
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