Skip to content

Add Support for 1.21.#80

Open
silverwolfg11 wants to merge 8 commits into
mainfrom
1-21-support
Open

Add Support for 1.21.#80
silverwolfg11 wants to merge 8 commits into
mainfrom
1-21-support

Conversation

@silverwolfg11
Copy link
Copy Markdown
Collaborator

@silverwolfg11 silverwolfg11 commented May 9, 2026

This PR updates the project to build for Paper/Spigot 1.21+.

Changes

Changes:

  • POM Changes:
    • Bump Folia version.
    • Bump adventure version.
    • Bump MockBukkit version
  • CI/CD Changes:
    • Remove JGitVer support (the plugin hasn't been updated in like 5+ years)
    • Use maven revisions directly in Github actions.
  • Code Changes:
    • Support Spigot hover events. This requires using Spigot's 1.21+ getComponentString which returns an SNBT formatted string. A parsing helper (ComponentHelper.java) was created to manually translate the SNBT components into JSON-formatted data that can be ingested by adventure.

User-Facing Changes:

  • Requires Java-21 runtime.

Testing

Tested on Spigot 1.21.8 by auctioning items with different lore, enchantments, names.

Gaps:

  • Didn't try items with custom textures or non-native NBT components.

Disclosure: Modifications were made in part with OpenAI GPT-5.5.

* Change min java version to 21.
* Use github actions to directly set verison tag.
@silverwolfg11 silverwolfg11 requested a review from elian1203 May 9, 2026 23:59
@elian1203
Copy link
Copy Markdown
Owner

Why was JGitVer removed, was it causing issues? And what is the impact on development builds/anything without a tag? Will it always use the hardcoded version in the POM?

Still haven't dived deep into your changes on the components, but is there no available library capable of handling this?

Since you bumped JDK to 21 is MC 1.20 no longer supported/what was the reason?

Thanks for working on this.

@silverwolfg11
Copy link
Copy Markdown
Collaborator Author

Thanks for the preliminary review.

Why was JGitVer removed, was it causing issues?

JGitVer was causing issues on my local development build; can't say whether that was an issue with my local setup, maven version, or something else. I was trying to find more recently maintained alternatives, but I didn't see anything with the same functionality.

And what is the impact on development builds/anything without a tag? Will it always use the hardcoded version in the POM?

Yeah it will use the revision property specified in the POM by default. The property is overridable via command-line setting though. Definitely open to alternative better solutions if you know any.

is there no available library capable of handling this?

The main problem is fetching the hover component data of an item in Spigot and converting that to something usable for adventure. I haven't developed against the modern version of Spigot, so there may be better solutions out there. What I saw was that Spigot 1.21 introduced a ItemMeta#getComponentString
which seems to return the SNBT component data of the item. During my initial search of libraries for SNBT parsing, I couldn't find a straightforward solution for parsing and converting that to an adventure-usable representation. I see that adventure does have a NBT implementation, so I'll give that a try and if that pans out I'll update the PR with that. But yeah, the manual parsing solution does not seem maintainable, so definitely open to better solutions. Would be nice to avoid libraries that have to be updated every Spigot release.

Since you bumped JDK to 21 is MC 1.20 no longer supported/what was the reason?

ItemMeta#getComponentString is a 1.21 API. Don't mind if we want to use reflection for the method; it was just easier for me to bump the versions for development and iteration.

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