Struct cobble_core::minecraft::launch::launch_options::LaunchOptions
source · [−]pub struct LaunchOptions {Show 16 fields
pub launcher_name: String,
pub launcher_version: String,
pub player_name: String,
pub profile_id: Option<String>,
pub token: Option<String>,
pub use_fullscreen: bool,
pub enable_window_size: bool,
pub window_width: u32,
pub window_height: u32,
pub enable_memory: bool,
pub min_memory: u32,
pub max_memory: u32,
pub java_exec: String,
pub enable_jvm_args: bool,
pub jvm_args: String,
pub environment_variables: HashMap<String, Option<String>>,
}
Expand description
Options for launching Minecraft. The options can be created using the builder pattern:
let options: LaunchOptions = LaunchOptionsBuilder::default()
.player_name("Steve".to_string())
.use_fullscreen(true)
.java_exec("/usr/bin/java".to_string())
.build();
Fields
launcher_name: String
Name of the launcher that gets passed as a game argument.
Defaults to this crates name when using LaunchOptionsBuilder
.
launcher_version: String
Version of the launcher that gets passed as a game argument.
Defaults to this crates version when using LaunchOptionsBuilder
.
player_name: String
Player name for the game.
Defaults to Steve
when using LaunchOptionsBuilder
.
profile_id: Option<String>
The profile ID.
This is needed for online mode.
token: Option<String>
The minecraft access token.
This is needed for online mode.
use_fullscreen: bool
Launches the game in fullscreen mode.
When set to true
, the window size is ignored.
Defaults to false
when using LaunchOptionsBuilder
.
enable_window_size: bool
Enables a custom resolution for the game window. Only has an effect when game is not launched in fullscreen mode.
Defaults to false
when using LaunchOptionsBuilder
.
window_width: u32
Game window width.
Used when enable_window_size
is set to true
.
Defaults to 1280
when using LaunchOptionsBuilder
.
window_height: u32
Game window height.
Used when enable_window_size
is set to true
.
Defaults to 720
when using LaunchOptionsBuilder
.
enable_memory: bool
Enables custom memory JVM arguments.
Defaults to false
when using LaunchOptionsBuilder
.
min_memory: u32
JVM initial heap size in megabytes.
Adds the -Xms
option to the command.
Gets added before jvm_args
.
Defaults to 1024
when using LaunchOptionsBuilder
.
max_memory: u32
JVM max heap size in megabytes.
Adds the -Xmx
option to the command. Gets added before
jvm_args`.
Defaults to 2048
when using LaunchOptionsBuilder
.
java_exec: String
Java executable used to launch minecraft.
Defaults to java
when using LaunchOptionsBuilder
.
enable_jvm_args: bool
Enables custom JVM arguments. When disabled and the version data provides JVM arguments, the arguments from the version data are used. When enabled, arguments from version data are ignored.
Defaults to false
when using LaunchOptionsBuilder
.
jvm_args: String
Custom JVM arguments.
Defaults to and empty string when using LaunchOptionsBuilder
.
environment_variables: HashMap<String, Option<String>>
Environment variables for the game process.
No environment variables set by default.
Trait Implementations
sourceimpl Clone for LaunchOptions
impl Clone for LaunchOptions
sourcefn clone(&self) -> LaunchOptions
fn clone(&self) -> LaunchOptions
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for LaunchOptions
impl Send for LaunchOptions
impl Sync for LaunchOptions
impl Unpin for LaunchOptions
impl UnwindSafe for LaunchOptions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more