Repository navigation
Browse mods for the server's real loader - #346
Merged
Merged
Conversation
The mod browser mapped the loader with hard-coded numbers left over from an older proto: 1 = forge, 2 = fabric, 3 = quilt, 4 = neoforge. The enum has since moved, so a NeoForge server fell through to the fabric default and searched and installed Fabric mods, and a Forge server did the same. The badge, the filter chip and the search request all showed Fabric for a NeoForge server. loaderSearchName switches on the generated ModLoader enum, and a test walks every value so a future renumbering fails in CI instead of in front of a user. Also fixes a mojibake middot in the dialog header.
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.
Problem
A NeoForge 1.21.1 server opened Browse & Install Online Mods and got a FABRIC badge, a
loader: fabricfilter, and Fabric search results.getLoaderStringmapped the loader with hard-coded numbers left over from an older proto:The enum has since moved (
VANILLA=1, FORGE=2, FABRIC=3, QUILT=4, … NEOFORGE=16), so:default→fabric,fabric,quilt.Every loader but the ones that happened to coincide was wrong, and the wrong loader silently installs mods the server cannot load. The backend was already correct — it derives the loader from
server.ModLoadervianormalizeLoaderName— but the dialog sends its ownloadervalue, so the filter won.Fix
$lib/utils/mod-loader.tsswitches on the generatedModLoaderenum instead of numbers:loaderSearchName(loader)→neoforge,forge,fabric,quilt,paper,spigot,bukkit,purpur,folia,sponge,mohist,catserver,arclight,vanilla, or''for a pack-driven loader (AUTO_CURSEFORGE,MODRINTH) where the pack decides.loaderDisplayName(loader)→ the badge label,ANYwhen there is no loader filter.A test walks every
ModLoadervalue, so a future renumbering fails in CI rather than in front of a user.Also fixed a mojibake
·in the dialog header ("Loader: NEOFORGE · Filtering for MC 1.21.1").Verification
Live on the dev instance, driving the real dialog (
scripts/review/plan-mod-browser.json):FABRICNEOFORGEloader: fabricloader: neoforgeNeoforgebun run check0 errors,bun run test72 pass (3 new).Refs OSS-247