lighty_modsloader/with_mods.rs
1// Copyright (c) 2025 Hamadi
2// Licensed under the MIT License
3
4//! Trait carrying the user-attached mods and optional modpack for an instance.
5
6use crate::request::ModRequest;
7
8#[cfg(any(feature = "modrinth", feature = "curseforge"))]
9use crate::modpack::ModpackSource;
10
11/// Exposes the mod requests and optional modpack source for a builder.
12pub trait WithMods {
13 /// User-attached mod requests pulled from Modrinth / CurseForge at install time.
14 fn mod_requests(&self) -> &[ModRequest];
15
16 /// Optional modpack to install before the user-attached mods. The
17 /// modpack's manifest is authoritative on the loader + Minecraft
18 /// version; conflicts are logged and the modpack wins.
19 #[cfg(any(feature = "modrinth", feature = "curseforge"))]
20 fn modpack(&self) -> Option<&ModpackSource> {
21 None
22 }
23}