elemental_driver/drivers/cleanroom/
mod.rs1use crate::{
2 descriptors::CLEANROOM_DRIVER,
3 driver::InstallerFamilyDriver,
4 drivers::retrofutura::{RetroFuturaLine, retrofutura_spec},
5 families::installer::{
6 InstallerMavenCatalog, InstallerMavenSource, MavenEndpoints, MavenInstallerSpec,
7 },
8 inspect::{LibraryPrefixSet, ProfileIdPattern, ProfiledDriverIdentity},
9 url::Origin,
10};
11
12pub const CLEANROOM_GAME_VERSION: &str = "1.12.2";
13
14#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
15pub struct CleanroomOrigin;
16
17impl Origin for CleanroomOrigin {
18 fn canonical(self) -> &'static str {
19 "https://repo.cleanroommc.com/releases"
20 }
21
22 fn all() -> &'static [Self] {
23 &[Self]
24 }
25}
26
27impl AsRef<str> for CleanroomOrigin {
28 fn as_ref(&self) -> &str {
29 self.canonical()
30 }
31}
32
33const CLEANROOM_LIBRARIES: LibraryPrefixSet =
34 LibraryPrefixSet::new(&["com.cleanroommc:cleanroom:"]);
35const CLEANROOM_IDENTITY: ProfiledDriverIdentity = ProfiledDriverIdentity::new(
36 CLEANROOM_DRIVER,
37 CLEANROOM_LIBRARIES,
38 CLEANROOM_LIBRARIES,
39 ProfileIdPattern::new("-cleanroom-"),
40);
41
42pub const CLEANROOM_SPEC: MavenInstallerSpec = retrofutura_spec(RetroFuturaLine {
43 identity: CLEANROOM_IDENTITY,
44 family_name: "cleanroom",
45 source_name: "cleanroom source",
46 loader_version_prefix: "cleanroom-",
47 canonical_origin: "https://repo.cleanroommc.com/releases",
48 group: "com.cleanroommc",
49 artifact: "cleanroom",
50 game_version: CLEANROOM_GAME_VERSION,
51});
52
53pub fn endpoints() -> MavenEndpoints {
54 MavenEndpoints::official(&CLEANROOM_SPEC)
55}
56
57pub fn source() -> InstallerMavenSource {
58 InstallerMavenSource::official(&CLEANROOM_SPEC)
59}
60
61pub fn driver() -> InstallerFamilyDriver {
62 InstallerFamilyDriver::for_spec(&CLEANROOM_SPEC)
63}
64
65pub fn catalog() -> InstallerMavenCatalog {
66 InstallerMavenCatalog::for_spec(&CLEANROOM_SPEC)
67}