Struct cobble_core::instance::InstanceBuilder
source · pub struct InstanceBuilder { /* private fields */ }
Expand description
Builder for Instance
.
Implementations§
source§impl InstanceBuilder
impl InstanceBuilder
sourcepub fn description<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn description<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
Optional description of the instance.
sourcepub fn version<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn version<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
Minecraft version identifier for this instance.
sourcepub fn instance_path<VALUE: Into<PathBuf>>(&mut self, value: VALUE) -> &mut Self
pub fn instance_path<VALUE: Into<PathBuf>>(&mut self, value: VALUE) -> &mut Self
Path for the instance folder.
This path contains the .minecraft
folder and some other metadata.
sourcepub fn libraries_path<VALUE: Into<PathBuf>>(&mut self, value: VALUE) -> &mut Self
pub fn libraries_path<VALUE: Into<PathBuf>>(&mut self, value: VALUE) -> &mut Self
Path for the libraries.
sourcepub fn assets_path<VALUE: Into<PathBuf>>(&mut self, value: VALUE) -> &mut Self
pub fn assets_path<VALUE: Into<PathBuf>>(&mut self, value: VALUE) -> &mut Self
Path for the assets.
sourcepub fn fullscreen(&mut self, value: bool) -> &mut Self
pub fn fullscreen(&mut self, value: bool) -> &mut Self
Enables fullscreen. Overwrites the custom window size.
Defaults to false
.
sourcepub fn enable_custom_window_size(&mut self, value: bool) -> &mut Self
pub fn enable_custom_window_size(&mut self, value: bool) -> &mut Self
Enables custom window size.
Takes effect when not launching in fullscreen.
The width and height can be configured with custom_width
and custom_height
.
Defaults to false
.
sourcepub fn custom_width(&mut self, value: u32) -> &mut Self
pub fn custom_width(&mut self, value: u32) -> &mut Self
Custom game window width.
Used when enable_custom_window_size
is enabled.
Defaults to 1280
.
sourcepub fn custom_height(&mut self, value: u32) -> &mut Self
pub fn custom_height(&mut self, value: u32) -> &mut Self
Custom game window height.
Used when enable_custom_window_size
is enabled.
Defaults to 720
.
sourcepub fn enable_custom_memory(&mut self, value: bool) -> &mut Self
pub fn enable_custom_memory(&mut self, value: bool) -> &mut Self
Enables custom JVM memory restrictions.
The minimum and maximum can be configured with custom_min_memory
and custom_max_memory
.
Defaults to false
.
sourcepub fn custom_min_memory(&mut self, value: u32) -> &mut Self
pub fn custom_min_memory(&mut self, value: u32) -> &mut Self
JVM initial heap size in megabytes.
Adds the -Xms
option to the command.
Gets added before custom_jvm_args
.
Used when enable_custom_memory
is enabled.
Defaults to 1024
.
sourcepub fn custom_max_memory(&mut self, value: u32) -> &mut Self
pub fn custom_max_memory(&mut self, value: u32) -> &mut Self
JVM max heap size in megabytes.
Adds the -Xmx
option to the command. Gets added before
custom_jvm_args. Used when
enable_custom_memory` is enabled.
Defaults to 2048
.
sourcepub fn custom_java_executable<VALUE: Into<String>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn custom_java_executable<VALUE: Into<String>>(
&mut self,
value: VALUE
) -> &mut Self
Custom java executable.
Defaults to None
.
sourcepub fn custom_jvm_arguments<VALUE: Into<String>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn custom_jvm_arguments<VALUE: Into<String>>(
&mut self,
value: VALUE
) -> &mut Self
Custom JVM arguments
Defaults to None
.
sourcepub fn environment_variables(
&mut self,
value: Vec<(String, Option<String>)>
) -> &mut Self
pub fn environment_variables(
&mut self,
value: Vec<(String, Option<String>)>
) -> &mut Self
Environment variables used for launching the game.
Defaults to vec![]
.
sourcepub fn installed(&mut self, value: bool) -> &mut Self
pub fn installed(&mut self, value: bool) -> &mut Self
Flag whether the instance was installed.
Defaults to false
.
sourcepub fn created(&mut self, value: OffsetDateTime) -> &mut Self
pub fn created(&mut self, value: OffsetDateTime) -> &mut Self
Created timestamp.
Defaults to OffsetDateTime::now_utc()
.
sourcepub fn fabric_version(&mut self, value: Option<String>) -> &mut Self
Available on crate feature fabric
only.
pub fn fabric_version(&mut self, value: Option<String>) -> &mut Self
fabric
only.Fabric loader version that is used by this instance.
Defaults to None
.
Trait Implementations§
source§impl Clone for InstanceBuilder
impl Clone for InstanceBuilder
source§fn clone(&self) -> InstanceBuilder
fn clone(&self) -> InstanceBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more