Skip to content

Improve server version parsing for Minecraft 26.1+ builds#34

Open
Despical wants to merge 1 commit intoIridium-Development:masterfrom
Despical:master
Open

Improve server version parsing for Minecraft 26.1+ builds#34
Despical wants to merge 1 commit intoIridium-Development:masterfrom
Despical:master

Conversation

@Despical
Copy link
Copy Markdown

@Despical Despical commented May 5, 2026

Summary

This PR fixes server version parsing in IridiumColorAPI for newer server version formats, including 26.1+ builds.

What was happening

IridiumColorAPI#getVersion() was using a fragile parsing approach that assumed older version formats such as 1.x.x-R0.1-SNAPSHOT.

With newer server versions, version strings can include different formats such as:

  • 26.1.2-R0.1-SNAPSHOT
  • 26.1.2-49-main@7799bf2 (2026-04-26T20:59:50Z)
  • git-Paper-43 (MC: 1.20.1)

Because of that, the old logic could extract invalid substrings like .1 and throw a NumberFormatException during static initialization.

What changed

  • Reworked getVersion() to extract the major version more safely
  • Kept support for legacy 1.x.x style versions
  • Added support for newer multi-part version formats, including 26.1+ style builds
  • Added broader test coverage for multiple real-world version strings

Dependency metadata

This PR also updates the Spigot dependency setup so it is no longer published as a transitive runtime dependency.

The library only needs the Bukkit/Spigot API at compile time, while tests still keep access to it through the test configuration.

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.

1 participant