pub struct ClientBootstrap {
pub settings: ClientSettings,
}
Fields§
§settings: ClientSettings
Implementations§
Source§impl ClientBootstrap
impl ClientBootstrap
Sourcepub fn new(settings: ClientSettings) -> Self
pub fn new(settings: ClientSettings) -> Self
Examples found in repository?
examples/launch_from_dot_minecraft.rs (lines 10-35)
9fn main() {
10 let bootstrap = ClientBootstrap::new(ClientSettings {
11 assets: get_mc_dir().join("assets"),
12 auth: ClientAuth {
13 username: "Sammwy_".to_string(),
14 access_token: None,
15 uuid: None,
16 },
17 game_dir: get_mc_dir(),
18 java_bin: PathBuf::from(
19 "C:\\Program Files\\Eclipse Adoptium\\jdk-17.0.7.7-hotspot\\bin\\java.exe",
20 ),
21 libraries_dir: get_mc_dir().join("libraries"),
22 manifest_file: get_mc_dir()
23 .join("versions")
24 .join("1.19.4")
25 .join("1.19.4.json"),
26 natives_dir: get_mc_dir().join("versions").join("1.19.4").join("natives"),
27 version: ClientVersion {
28 version: "1.19.4".to_string(),
29 version_type: "release".to_string(),
30 },
31 version_jar_file: get_mc_dir()
32 .join("versions")
33 .join("1.19.4")
34 .join("1.19.4.jar"),
35 });
36
37 bootstrap.launch().unwrap();
38}
pub fn get_assets_dir(&self) -> PathBuf
pub fn get_game_dir(&self) -> PathBuf
pub fn get_json_file(&self) -> PathBuf
pub fn get_jar_file(&self) -> PathBuf
pub fn get_libs_dir(&self) -> PathBuf
pub fn get_natives_dir(&self) -> PathBuf
pub fn build_args(&self) -> Result<Vec<String>, ClientBootstrapError>
Sourcepub fn launch(&self) -> Result<i32, ClientBootstrapError>
pub fn launch(&self) -> Result<i32, ClientBootstrapError>
Examples found in repository?
examples/launch_from_dot_minecraft.rs (line 37)
9fn main() {
10 let bootstrap = ClientBootstrap::new(ClientSettings {
11 assets: get_mc_dir().join("assets"),
12 auth: ClientAuth {
13 username: "Sammwy_".to_string(),
14 access_token: None,
15 uuid: None,
16 },
17 game_dir: get_mc_dir(),
18 java_bin: PathBuf::from(
19 "C:\\Program Files\\Eclipse Adoptium\\jdk-17.0.7.7-hotspot\\bin\\java.exe",
20 ),
21 libraries_dir: get_mc_dir().join("libraries"),
22 manifest_file: get_mc_dir()
23 .join("versions")
24 .join("1.19.4")
25 .join("1.19.4.json"),
26 natives_dir: get_mc_dir().join("versions").join("1.19.4").join("natives"),
27 version: ClientVersion {
28 version: "1.19.4".to_string(),
29 version_type: "release".to_string(),
30 },
31 version_jar_file: get_mc_dir()
32 .join("versions")
33 .join("1.19.4")
34 .join("1.19.4.jar"),
35 });
36
37 bootstrap.launch().unwrap();
38}
Auto Trait Implementations§
impl Freeze for ClientBootstrap
impl RefUnwindSafe for ClientBootstrap
impl Send for ClientBootstrap
impl Sync for ClientBootstrap
impl Unpin for ClientBootstrap
impl UnwindSafe for ClientBootstrap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more