Skip to content

Browse mods for the server's real loader - #346

Merged
athNdev merged 1 commit into
mainfrom
fix/mod-browser-loader
Nov 4, 2026
Merged

athNdev merged 1 commit into
mainfrom
fix/mod-browser-loader

Conversation

@athNdev

@athNdev athNdev commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Problem

A NeoForge 1.21.1 server opened Browse & Install Online Mods and got a FABRIC badge, a loader: fabric filter, and Fabric search results.

getLoaderString mapped the loader with hard-coded numbers left over from an older proto:

case 1: return 'forge';
case 2: return 'fabric';
case 3: return 'quilt';
case 4: return 'neoforge';
default: return 'fabric';

The enum has since moved (VANILLA=1, FORGE=2, FABRIC=3, QUILT=4, … NEOFORGE=16), so:

  • NeoForge (16) hit default → fabric,
  • Forge (2) also returned fabric,
  • Fabric (3) returned 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.ModLoader via normalizeLoaderName — but the dialog sends its own loader value, so the filter won.

Fix

$lib/utils/mod-loader.ts switches on the generated ModLoader enum 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, ANY when there is no loader filter.

A test walks every ModLoader value, 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):

before after
badge FABRIC NEOFORGE
filter chip loader: fabric loader: neoforge
results Fabric API first Fabric API gone; FerriteCore / Lithium tagged Neoforge

bun run check 0 errors, bun run test 72 pass (3 new).

Refs OSS-247

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.
@athNdev
athNdev merged commit 4a56a92 into main Nov 4, 2026
11 checks passed
@athNdev
athNdev deleted the fix/mod-browser-loader branch November 4, 2026 09:09
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