fix: Resource Packs Compatibility Check (#498)

Sometimes they are tagged as only supporting Vanilla what is true but
that causes issues when downloading into a fabric cluster. Since fabric
IS NOT vanilla they "don't work" thus won't install. This just skips
that check and downloads it anyways

Co-authored-by: Wyvest <wyvestbusiness@gmail.com>
This commit is contained in:
Jacob 2026-03-08 15:52:09 +08:00 • committed by GitHub
parent 978732a8fa
commit 247d23083d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View file

@ -116,6 +116,7 @@ export interface ModCardContextApi {
mods?: Array<ModpackFile>;
installedPackages?: Array<PackageModel>;
useToggleMode?: boolean;
skipCompatibilityChecks?: boolean;
}
const DEFAULT_MOD_CARD_CONTEXT: ModCardContextApi = {};
@ -126,7 +127,7 @@ export function useModCardContext() {
}
export function ModCard({ file, cluster }: ModCardProps) {
const { enableClickToDownload, onClickOnMod, useVerticalGridLayout, mods, installedPackages, useToggleMode } = useModCardContext();
const { enableClickToDownload, onClickOnMod, useVerticalGridLayout, mods, installedPackages, useToggleMode, skipCompatibilityChecks = null } = useModCardContext();
const queryClient = useQueryClient();
const [modMetadata, setModMetadata] = useState<ModInfo>({ name: getModMetaDataName(file), description: null, author: null, iconURL: null, url: null, managed: false, packageSlug: null });
@ -183,13 +184,13 @@ export function ModCard({ file, cluster }: ModCardProps) {
if (dependency.dependency_type === 'required') {
const slug = dependency.project_id ?? '';
const versions = await bindings.core.getPackageVersions(pkg.provider, slug, cluster.mc_version, cluster.mc_loader, 0, 1);
await bindings.core.downloadPackage(pkg.provider, slug, versions.items[0].version_id, cluster.id, null);
await bindings.core.downloadPackage(pkg.provider, slug, versions.items[0].version_id, cluster.id, skipCompatibilityChecks);
}
await bindings.core.downloadPackage(pkg.provider, pkg.id, version.version_id, cluster.id, null);
await bindings.core.downloadPackage(pkg.provider, pkg.id, version.version_id, cluster.id, skipCompatibilityChecks);
}
else {
await bindings.core.downloadExternalPackage(kind.External, cluster.id, null, null);
await bindings.core.downloadExternalPackage(kind.External, cluster.id, null, skipCompatibilityChecks);
}
});

View file

@ -33,6 +33,7 @@ function RouteComponent() {
const context = useMemo<ModCardContextApi>(() => ({
enableClickToDownload: true,
installedPackages,
skipCompatibilityChecks: true,
}), [installedPackages]);
if (allBundles.every(b => b.manifest.files.length === 0))