Skip to content

Commit 247d230

Browse files
KathundWyvest
andauthored
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>
1 parent 978732a commit 247d230

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

apps/oneclient/frontend/src/components/Bundle/ModCard.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export interface ModCardContextApi {
116116
mods?: Array<ModpackFile>;
117117
installedPackages?: Array<PackageModel>;
118118
useToggleMode?: boolean;
119+
skipCompatibilityChecks?: boolean;
119120
}
120121

121122
const DEFAULT_MOD_CARD_CONTEXT: ModCardContextApi = {};
@@ -126,7 +127,7 @@ export function useModCardContext() {
126127
}
127128

128129
export function ModCard({ file, cluster }: ModCardProps) {
129-
const { enableClickToDownload, onClickOnMod, useVerticalGridLayout, mods, installedPackages, useToggleMode } = useModCardContext();
130+
const { enableClickToDownload, onClickOnMod, useVerticalGridLayout, mods, installedPackages, useToggleMode, skipCompatibilityChecks = null } = useModCardContext();
130131
const queryClient = useQueryClient();
131132

132133
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) {
183184
if (dependency.dependency_type === 'required') {
184185
const slug = dependency.project_id ?? '';
185186
const versions = await bindings.core.getPackageVersions(pkg.provider, slug, cluster.mc_version, cluster.mc_loader, 0, 1);
186-
await bindings.core.downloadPackage(pkg.provider, slug, versions.items[0].version_id, cluster.id, null);
187+
await bindings.core.downloadPackage(pkg.provider, slug, versions.items[0].version_id, cluster.id, skipCompatibilityChecks);
187188
}
188189

189-
await bindings.core.downloadPackage(pkg.provider, pkg.id, version.version_id, cluster.id, null);
190+
await bindings.core.downloadPackage(pkg.provider, pkg.id, version.version_id, cluster.id, skipCompatibilityChecks);
190191
}
191192
else {
192-
await bindings.core.downloadExternalPackage(kind.External, cluster.id, null, null);
193+
await bindings.core.downloadExternalPackage(kind.External, cluster.id, null, skipCompatibilityChecks);
193194
}
194195
});
195196

apps/oneclient/frontend/src/routes/app/cluster/resource-packs.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ function RouteComponent() {
3333
const context = useMemo<ModCardContextApi>(() => ({
3434
enableClickToDownload: true,
3535
installedPackages,
36+
skipCompatibilityChecks: true,
3637
}), [installedPackages]);
3738

3839
if (allBundles.every(b => b.manifest.files.length === 0))

0 commit comments

Comments
 (0)