pub enum MinecraftVersion {
Release(u32, u32, u32),
Snapshot(u32, u32, char),
Custom(String),
}
Expand description
一个用于表达当前 Minecraft 版本号的枚举结构
用来根据版本判断使用不同的安装方式,还有相关的资源获取等
Variants§
Release(u32, u32, u32)
正式版本的版本号
Snapshot(u32, u32, char)
快照版本的版本号
Custom(String)
一些特殊版本的版本号,有可能是 Beta 或者 Alpha 等远古版本或被特殊命名的版本
Implementations§
Source§impl MinecraftVersion
impl MinecraftVersion
Sourcepub fn required_java_version(&self) -> u8
pub fn required_java_version(&self) -> u8
检查该版本需要的最低 Java 版本
目前检测到 1.17+ 的正式版本都会返回 16,其余的返回 8
Sourcepub fn should_forge_use_override_installiation(&self) -> bool
pub fn should_forge_use_override_installiation(&self) -> bool
确认如果该版本需要安装 Forge,是否使用覆盖 minecraft.jar 的方式进行安装
一般在版本为 1.5.1 或者更早时为 true
如果为 false
则使用 Forge 安装器安装
Sourcepub fn should_forge_use_client_or_universal(&self) -> bool
pub fn should_forge_use_client_or_universal(&self) -> bool
确认如果该版本需要安装 Forge,下载的文件名尾缀是否是 client
还是 universal
一般在版本为 1.2.5 或者更早时为 true
如果为 false
则使用 universal
作为尾缀
Trait Implementations§
Source§impl Clone for MinecraftVersion
impl Clone for MinecraftVersion
Source§fn clone(&self) -> MinecraftVersion
fn clone(&self) -> MinecraftVersion
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MinecraftVersion
impl Debug for MinecraftVersion
Source§impl Default for MinecraftVersion
impl Default for MinecraftVersion
Source§impl Display for MinecraftVersion
impl Display for MinecraftVersion
Source§impl FromStr for MinecraftVersion
impl FromStr for MinecraftVersion
Source§impl PartialEq for MinecraftVersion
impl PartialEq for MinecraftVersion
Source§impl PartialOrd for MinecraftVersion
impl PartialOrd for MinecraftVersion
impl Eq for MinecraftVersion
impl StructuralPartialEq for MinecraftVersion
Auto Trait Implementations§
impl Freeze for MinecraftVersion
impl RefUnwindSafe for MinecraftVersion
impl Send for MinecraftVersion
impl Sync for MinecraftVersion
impl Unpin for MinecraftVersion
impl UnwindSafe for MinecraftVersion
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.