diff --git a/config.lock b/config.lock index 08e68d0..a23bfed 100644 --- a/config.lock +++ b/config.lock @@ -4,6 +4,7 @@ version = "1.20.4" build = "2165" path = "core/purpur.jar" +<<<<<<< HEAD [plugins.chunky] version = "iwsbfPGg" path = "plugins/chunky.jar" @@ -15,3 +16,16 @@ path = "plugins/simple-voice-chat.jar" [plugins.itemswapper] version = "UKVc6pCj" path = "plugins/itemswapper.jar" +======= +[plugins.simple-voice-chat] +version = "WvPmSPnl" +path = "plugins/simple-voice-chat.jar" + +[plugins.itemswapper] +version = "UKVc6pCj" +path = "plugins/itemswapper.jar" + +[plugins.chunky] +version = "iwsbfPGg" +path = "plugins/chunky.jar" +>>>>>>> 3b989df40d7b47f4ec089cca7bd3753d57fe090e diff --git a/config.toml b/config.toml index f27cb5c..1a67c31 100644 --- a/config.toml +++ b/config.toml @@ -29,4 +29,4 @@ key = "SUPEREKLy" path_to_core = "core" # path_to_mods = "" path_to_plugins = "plugins" -path_to_configs = "config.lock" +path_to_lock = "config.lock" diff --git a/src/downloader/mod.rs b/src/downloader/mod.rs index 8067717..8a049dd 100644 --- a/src/downloader/mod.rs +++ b/src/downloader/mod.rs @@ -1,7 +1,7 @@ pub mod hash; mod models; -use crate::config::core::Provider; +use crate::config::core::{Core, Provider}; use crate::config::plugins::{Plugin, Sources}; use crate::config::Config; use crate::downloader::models::cores::folia::Folia; @@ -44,25 +44,25 @@ impl<'config, 'lock> Downloader<'config, 'lock> { /////Core section ///Check core and add it into list for download. - async fn get_core_link(&self) -> Result<(String, ChooseHash, String), DownloadErrors> { + async fn get_core_link(core: &Core) -> Result<(String, ChooseHash, String), DownloadErrors> { info!("Start to match provider of core"); - match self.config.core.provider { - Provider::Vanilla => Vanilla::get_link(&self.config.core).await, - Provider::Paper => Paper::get_link(&self.config.core).await, - Provider::Folia => Folia::get_link(&self.config.core).await, - Provider::Purpur => Purpur::get_link(&self.config.core).await, + match core.provider { + Provider::Vanilla => Vanilla::get_link(core).await, + Provider::Paper => Paper::get_link(core).await, + Provider::Folia => Folia::get_link(core).await, + Provider::Purpur => Purpur::get_link(core).await, Provider::Fabric => todo!(), Provider::Forge => todo!(), Provider::NeoForge => todo!(), - Provider::Waterfall => Waterfall::get_link(&self.config.core).await, - Provider::Velocity => Velocity::get_link(&self.config.core).await, + Provider::Waterfall => Waterfall::get_link(core).await, + Provider::Velocity => Velocity::get_link(core).await, } } /// Make reqwest to check version and download core. async fn core_reqwest(&mut self) -> Result<(), DownloadErrors> { //Find version to download - let (link, hash, version) = self.get_core_link().await?; + let (link, hash, version) = Self::get_core_link(&self.config.core).await?; let core_name = self.config.core.provider.get_name().await; debug!("Find {} link: {}, hash: {}", core_name, &link, &hash); info!("Start to download {}!", core_name);