Enum scl_core::semver::MinecraftVersion
source · 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<MinecraftVersion> for MinecraftVersion
impl PartialEq<MinecraftVersion> for MinecraftVersion
source§fn eq(&self, other: &MinecraftVersion) -> bool
fn eq(&self, other: &MinecraftVersion) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<MinecraftVersion> for MinecraftVersion
impl PartialOrd<MinecraftVersion> for MinecraftVersion
source§fn partial_cmp(&self, other: &MinecraftVersion) -> Option<Ordering>
fn partial_cmp(&self, other: &MinecraftVersion) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for MinecraftVersion
impl StructuralEq for MinecraftVersion
impl StructuralPartialEq for MinecraftVersion
Auto Trait Implementations§
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.