diff --git a/apps/frontend/src/ui/pages/cluster/ClusterRoot.tsx b/apps/frontend/src/ui/pages/cluster/ClusterRoot.tsx index 386e56ad..ac75a494 100644 --- a/apps/frontend/src/ui/pages/cluster/ClusterRoot.tsx +++ b/apps/frontend/src/ui/pages/cluster/ClusterRoot.tsx @@ -12,7 +12,7 @@ import ClusterScreenshots from './ClusterScreenshots'; import ClusterSettings from './ClusterSettings'; import ClusterGame from './ClusterGame'; import useClusterContext, { ClusterProvider } from '~ui/hooks/useCluster'; -import { supportsMods } from '~utils/helpers'; +import { supportsMods } from '~utils'; import { tryResult } from '~ui/hooks/useCommand'; import { bridge } from '~imports'; import PlayerHead from '~ui/components/game/PlayerHead'; diff --git a/apps/frontend/src/utils/index.ts b/apps/frontend/src/utils/index.ts index 2f4d7b26..27edc56b 100644 --- a/apps/frontend/src/utils/index.ts +++ b/apps/frontend/src/utils/index.ts @@ -1,8 +1,18 @@ -import type { VersionType } from '~bindings'; +import type { Cluster, Loader, VersionType } from '~bindings'; export * from './PausableTimer'; export * from './sorting'; +export function supportsMods(loader?: Cluster | Loader): boolean { + if (loader === undefined) + return false; + + if (typeof loader !== 'string') + loader = loader.meta.loader; + + return loader !== 'vanilla'; +} + export function formatVersionRelease(release: VersionType): string { const mapping: { [key in VersionType]: string } = { old_alpha: 'Alpha',