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:
parent
978732a8fa
commit
247d23083d
2 changed files with 6 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue