Fix ItemsAdder startup issues & add MiniMessage support - #644
Open
diamond-turtle wants to merge 5 commits into
Open
diamond-turtle wants to merge 5 commits into
diamond-turtle wants to merge 5 commits into
Conversation
Introduces me.RockinChaos.itemjoin.item.provider (ItemProvider, ItemProviderRegistry) so items can be sourced as real, live ItemStacks from a third-party plugin instead of faked with copied NBT data. ItemsAdderProvider is the first implementation, using ItemsAdder's CustomStack API (getInstance/getItemStack, byItemStack) for both resolving and reverse-matching items. Items configured with provider/provider-key are resolved fresh on every ItemMap update, so changes to the source ItemsAdder item are reflected without reloading ItemJoin.
Item display names/lores and all plugin messages/lang-file strings now accept MiniMessage tags (gradients, <bold>, <#RRGGBB>, etc.) alongside the existing '&' legacy color codes. Tags are resolved to legacy section-sign codes (with full hex precision) via a new MiniMessageUtils utility before StringUtils.translateLayout runs, so existing configs are unaffected. Lang-file/message sends previously routed through ChaosCore's opaque sendLangMessage/dispatchMessage now go through drop-in wrapper methods with identical signatures that pre-resolve tags before delegating to the same underlying send logic. Adds net.kyori adventure-api/adventure-text-minimessage/ adventure-text-serializer-legacy as shaded, relocated dependencies, matching the existing ChaosCore relocation pattern.
ItemsAdder loads its custom item registry and resource pack asynchronously, which is not guaranteed to be done by the time ItemJoin resolves ItemsAdder-backed items during server startup. Players ended up holding ItemStacks missing data such as tooltips until items were manually refreshed. Now listens for ItemsAdderLoadDataEvent and re-resolves/replaces any already-held ItemStacks sourced from the provider.
…n time ItemJoin loads at STARTUP while ItemsAdder loads POSTWORLD, so ItemJoin's provider registry and event listener always registered before ItemsAdder ever became "enabled" - isPluginEnabled() was permanently false at that point on a cold boot, regardless of softdepend order (softdepend only orders plugins within the same load phase). This silently disabled the ItemsAdder item provider and its refresh listener on every real restart, only working after a manual /ij reload once ItemsAdder was already up. Switch both checks to getPlugin() != null, which reflects the plugin being loaded rather than enabled, and add logging so the detection state is visible in the console on startup.
…ssage colors Bukkit's deprecated String-based ItemMeta setters (setDisplayName, setLore) round-trip through a legacy parser that snaps hex/gradient MiniMessage colors down to the nearest of the 16 named ChatColors, and can't carry ObjectComponent-based tags like <head>/<sprite> at all. Switch item name, lore, and outgoing chat/lang messages to Adventure's Component-based APIs (customName, lore, Audience#sendMessage) so MiniMessage output survives intact. MiniMessage unconditionally rejects any literal '§' character, so translateLayoutComponent() only ever hands MiniMessage raw, untranslated text (gated behind a TAG_HINT check so untagged strings skip straight to the existing legacy '&' pipeline), pre-resolving only the placeholders that could plausibly appear as a tag argument beforehand. Also fixes two spots (cooldown messages) that were resolving the %item% placeholder from the already color-translated display name instead of the raw config name. Bumps Adventure to 4.26.1 and switches the API dependency from spigot-api to paper-api, with Adventure moved to provided scope, since the relocated/shaded Adventure classes shipped by spigot-api are stale enough to throw NoSuchMethodError against these newer Component APIs at runtime.
Author
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This PR fixes several ItemsAdder integration issues and adds MiniMessage support for item names/lore.
Changes
ItemsAdder
MiniMessage
Notes
Build