Compare versions numerically so the head detector runs on 26.x, and fix the VaultUnlockedAPI version - #181
Open
Aelshi-nui wants to merge 2 commits into
Open
Conversation
version.contains("1.21.1") matches nothing on 26.1 and up, so the head
detector reported itself irrelevant on the versions that still have the
bug. versionUtil now parses versions into numbers and exposes isAtLeast,
which orders 1.x and the year based drops correctly.
2.19.0 is not published. The creatorfromhell repo has 2.15 through 2.20, so resolution fails and master does not build from a clean checkout.
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 replaces #180. Same two files as before, plus the one line that makes master build. Two commits, so the build fix can be dropped if you would rather take it separately.
The version detection fix, unchanged from #180:
isRelevantForCurrentVersion() decided whether the detector applied by matching on the version string, with checks like version.contains("1.21.1"). Minecraft dropped the leading "1." in 2026, so the drops after 1.21.11 are 26.1, 26.1.1, 26.1.2 and 26.2, and none of those match any of those checks. IncompatibilityChecker does "if (!detector.isRelevantForCurrentVersion()) continue;" before it ever calls detect(), so on a 26.x server the detector reports itself irrelevant and gets skipped entirely. The empty player head NPE is unguarded again on exactly the versions that still have the bug, and the offline skull owner fix from #179 never runs there either.
versionUtil now parses a version into its numeric parts and exposes isAtLeast(String). Both numbering schemes compare correctly against each other with no special cases, because 26 is greater than 1. getBukkitVersionType() keeps its old behaviour, it just runs on the numeric comparison instead of the padded string compare, which was only accidentally right. The detector's gate becomes isAtLeast(FIRST_AFFECTED_VERSION), and FIXED_IN_VERSION now goes through the same comparison, so setting it will actually work rather than silently doing nothing. detect() is untouched, so your #179 profile work is exactly as you left it.
The build fix, which is new:
In #180 I said VaultUnlockedAPI 2.19.0 could not be found anywhere, and that was wrong. It is in the codemc-creatorfromhell repo, which is already in the pom. That repo publishes 2.15, 2.16, 2.17, 2.18, 2.19 and 2.20. There is no 2.19.0, so resolution fails on the version string rather than the repository. Changing it to 2.19 fixes it, and I verified 2.19 and 2.20 both return 200 for jar and pom while 2.19.0 returns 404 on every repository in the pom.
With that corrected, resolution succeeds and the build gets to compiling 176 sources. What remains is unrelated to this PR and I could not verify it here: BlockLockerHook, LWCHook, ResidenceHook, EssentialsHelper, CMIWorthHandler and EssentialsWorthHandler fail because blocklocker 1.7, LWCX 2.2.5, residence 4.8.8.2, CMI-API 9.7.14.3 and essentials 2.22.0 are not published in any of the ten repositories the pom lists. I checked each one directly. Those build for you because the jars are in your local repository, the same way you suggested I install LWCX, so a clean checkout will stop there for anyone else. Not something I want to touch in this PR, but worth knowing.
On verification: both changed files compile cleanly, and with the version string corrected every remaining error line is inside those six files, none in versionUtil or the detector. The version comparison carries twenty assertions covering the ordering across the scheme change, including 1.21.11 below 26.1, 26.1 below 26.1.1 below 26.1.2 below 26.2, real Bukkit strings like "26.2-R0.1-SNAPSHOT", the 1.4.5 and R0.3 pairs getBukkitVersionType relies on, and empty input. All pass.
Branched off current master, so no file mode churn and no dependency changes beyond that one version string.