Struct cobble_core::instance::InstanceBuilder
source · [−]pub struct InstanceBuilder { /* private fields */ }
Expand description
Builder for Instance
.
Implementations
sourceimpl InstanceBuilder
impl InstanceBuilder
sourcepub fn uuid(&mut self, value: Uuid) -> &mut Self
pub fn uuid(&mut self, value: Uuid) -> &mut Self
Instance UUID
.
Defaults to uuid::Uuid::new_v4()
when using InstanceBuilder
.
sourcepub fn description(&mut self, value: String) -> &mut Self
pub fn description(&mut self, value: String) -> &mut Self
Description of the instance.
Default to an empty string when using InstanceBuilder
.
sourcepub fn instance_path(&mut self, value: String) -> &mut Self
pub fn instance_path(&mut self, value: String) -> &mut Self
Path for the instance.
This path contains the .minecraft
folder and the version data JSON.
sourcepub fn libraries_path(&mut self, value: String) -> &mut Self
pub fn libraries_path(&mut self, value: String) -> &mut Self
Path for libraries.
sourcepub fn assets_path(&mut self, value: String) -> &mut Self
pub fn assets_path(&mut self, value: String) -> &mut Self
Path for assets.
sourcepub fn use_fullscreen(&mut self, value: bool) -> &mut Self
pub fn use_fullscreen(&mut self, value: bool) -> &mut Self
Launches the game in fullscreen mode.
When set to true
, the window size is ignored.
Defaults to false
when using InstanceBuilder
.
sourcepub fn enable_window_size(&mut self, value: bool) -> &mut Self
pub fn enable_window_size(&mut self, value: bool) -> &mut Self
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 InstanceBuilder
.
sourcepub fn window_width(&mut self, value: u32) -> &mut Self
pub fn window_width(&mut self, value: u32) -> &mut Self
Game window width.
Used when enable_window_size
is set to true.
Defaults to 1280
when using InstanceBuilder
.
sourcepub fn window_height(&mut self, value: u32) -> &mut Self
pub fn window_height(&mut self, value: u32) -> &mut Self
Game window height.
Used when enable_window_size
is set to true.
Defaults to 720
when using InstanceBuilder
.
sourcepub fn enable_memory(&mut self, value: bool) -> &mut Self
pub fn enable_memory(&mut self, value: bool) -> &mut Self
Enables custom memory JVM arguments.
Defaults to false
when using InstanceBuilder
.
sourcepub fn min_memory(&mut self, value: u32) -> &mut Self
pub fn min_memory(&mut self, value: u32) -> &mut Self
JVM initial heap size in megabytes.
Adds the -Xms
option to the command.
Gets added before jvm_args
.
Defaults to 1024
when using InstanceBuilder
.
sourcepub fn max_memory(&mut self, value: u32) -> &mut Self
pub fn max_memory(&mut self, value: u32) -> &mut Self
JVM max heap size in megabytes.
Adds the -Xmx
option to the command. Gets added before
jvm_args`.
Defaults to 2048
when using InstanceBuilder
.
sourcepub fn enable_java_exec(&mut self, value: bool) -> &mut Self
pub fn enable_java_exec(&mut self, value: bool) -> &mut Self
Enables a custom java executable.
Launching an instance tries to use the instances java_exec
when enabled, then tries java_exec
for
Defaults to false
when using InstanceBuilder
.
sourcepub fn java_exec(&mut self, value: String) -> &mut Self
pub fn java_exec(&mut self, value: String) -> &mut Self
Java executable used to launch minecraft.
Defaults to java
when using InstanceBuilder
.
sourcepub fn enable_jvm_args(&mut self, value: bool) -> &mut Self
pub fn enable_jvm_args(&mut self, value: bool) -> &mut Self
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 InstanceBuilder
.
sourcepub fn jvm_args(&mut self, value: String) -> &mut Self
pub fn jvm_args(&mut self, value: String) -> &mut Self
Custom JVM arguments.
Defaults to and empty string when using InstanceBuilder
.
sourcepub fn created(&mut self, value: OffsetDateTime) -> &mut Self
pub fn created(&mut self, value: OffsetDateTime) -> &mut Self
Created timestamp.
Defaults to time::OffsetDateTime::now_utc()
when using InstanceBuilder
.
Trait Implementations
sourceimpl Clone for InstanceBuilder
impl Clone for InstanceBuilder
sourcefn clone(&self) -> InstanceBuilder
fn clone(&self) -> InstanceBuilder
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 InstanceBuilder
impl Send for InstanceBuilder
impl Sync for InstanceBuilder
impl Unpin for InstanceBuilder
impl UnwindSafe for InstanceBuilder
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