Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NeoForge 支持 #4045

Merged
merged 39 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
7ba79db
feat(neoforge): 添加了 NeoForge 的安装选项,并支持获取版本列表
Pigeon0v0 Jun 15, 2024
e731ef6
ui: 显示 NeoForge 版本属性(测试版 / 稳定版)
Pigeon0v0 Jun 15, 2024
8d9dc47
fix: NeoForge 版本列表排序,但是抽象实现
Pigeon0v0 Jun 15, 2024
655364b
fix: 一处逻辑判断错误,但未解决版本判断错误的问题
Pigeon0v0 Jun 15, 2024
65d21d4
Installer 下载和代码清理
Pigeon0v0 Jun 15, 2024
31e391f
optimize: version name and icon
JingHai-Lingyun Jun 15, 2024
d8fe599
fix: 所有版本都显示为测试版 / 正式版
Pigeon0v0 Jun 15, 2024
0e0335e
ui: 添加 NeoForge 手动安装 Tab
Pigeon0v0 Jun 16, 2024
f4b1e3e
feat: 正式支持 NeoForge 自动安装
Pigeon0v0 Jun 16, 2024
27825ed
Update PageDownloadInstall.xaml.vb
JingHai-Lingyun Jun 16, 2024
d305dd3
fix: 版本列表不能正常显示核心 NeoForge 版本
Pigeon0v0 Jun 16, 2024
c31e3b5
Merge branch 'neoforge' into neoforge
Pigeon0v0 Jun 16, 2024
030c498
Merge pull request #2 from JingHai-Lingyun/neoforge
Pigeon0v0 Jun 16, 2024
66182f2
fix: Icon 显示及其导致的崩溃问题
Pigeon0v0 Jun 16, 2024
f3079dd
feat: NeoForge 整合包安装
Pigeon0v0 Jun 16, 2024
9c64dc0
尝试修复 NeoForge 手动安装包列表加载不出的问题,但是失败了
Pigeon0v0 Jun 16, 2024
9dab0b8
改一行注释
Pigeon0v0 Jun 16, 2024
136803f
fix: 回滚修改,修复版本列表问题
Pigeon0v0 Jun 16, 2024
f83afdb
fix: 1.20.1 NeoForge 下载地址拼接可能有误(如果版本为 1.20.1 则硬编码以避免问题)
Pigeon0v0 Jun 21, 2024
e0ae696
chores: 界面文本更改,现在安装的是 NeoForge 还是 Forge 更清晰了
Pigeon0v0 Jun 21, 2024
3bc3416
fix: 1.20.1 NeoForge 安装失败(Json 路径错误)
Pigeon0v0 Jun 21, 2024
7d50ed1
fix: 1.20.1 NeoForge 近期版本无法安装(Json 路径错误)
Pigeon0v0 Jun 21, 2024
70a6b6a
chores: 删除调试用信息
Pigeon0v0 Jun 21, 2024
61ac627
fix: 1.20.1 NeoForge 无法安装(Json 路径拼接错误)
Pigeon0v0 Jun 22, 2024
3f5c292
feat(neoforge): NeoForge 官方源版本列表
Pigeon0v0 Jun 26, 2024
707b6ee
fix: NeoForge 手动安装版本列表不能正常加载(修完了)
Pigeon0v0 Jun 26, 2024
2cfa9b2
feat: NeoForge BMCLAPI 版本列表获取
Pigeon0v0 Jun 26, 2024
ee10caa
fix: NeoForge 官方源不可用
Pigeon0v0 Jun 26, 2024
6efaa09
fix: 官方源总是 Fallback 到 BMCLAPI
Pigeon0v0 Jun 27, 2024
ac6ed8d
chores: Clean up
Pigeon0v0 Jun 27, 2024
1b53489
fix: BMCLAPI 获取支持的 Neo 列表时会意外的包含 1.20
Pigeon0v0 Jun 27, 2024
b61081f
:ok_hand: 修改一些龙猫的审查
youzi-2333 Jun 27, 2024
f98578f
Merge pull request #4 from youzi-2333/pigeon-neoforge
Pigeon0v0 Jun 27, 2024
a54cfef
代码清理
Pigeon0v0 Jun 27, 2024
cf43244
refactor: 合并 Forge 和 NeoForge 部分代码
Pigeon0v0 Jun 28, 2024
4dba7c9
chores: 代码可读性和相关优化
Pigeon0v0 Jun 28, 2024
3c44a55
refactor: NeoForge BMCLAPI 版本列表(爱来自 bangbang93)
Pigeon0v0 Jun 30, 2024
bec5ddd
chores: 代码清理
Pigeon0v0 Jun 30, 2024
7921184
chores: 一些判断和命名修改
Pigeon0v0 Jun 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Plain Craft Launcher 2/FormMain.xaml.vb
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,7 @@ Install:
DownloadClient = 4
DownloadOptiFine = 5
DownloadForge = 6
DownloadNeoForge = 13
DownloadFabric = 7
DownloadLiteLoader = 8
DownloadMod = 10
Expand Down
Binary file added Plain Craft Launcher 2/Images/Icons/NeoForged.png
Pigeon0v0 marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
178 changes: 178 additions & 0 deletions Plain Craft Launcher 2/Modules/Minecraft/ModDownload.vb
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,184 @@

#End Region

#Region "DlNeoForgeVersion | NeoForge 版本列表"

Public Class DlNeoForgeVersionEntry
''' <summary>
''' 完整的版本名,如 “neoforge-20.4.30-beta”。
''' </summary>
Public Version As String
Pigeon0v0 marked this conversation as resolved.
Show resolved Hide resolved
''' <summary>
''' 对应的 Minecraft 版本,如“1.12.2”。
''' </summary>
Public Inherit As String
''' <summary>
''' 发布时间,格式为“yyyy/MM/dd HH:mm”。
''' </summary>
Public ReleaseTime As String
''' <summary>
''' 文件的 MD5 或 SHA1(BMCLAPI 的老版本是 MD5,新版本是 SHA1;官方源总是 MD5)。
''' </summary>
Public Hash As String = Nothing
''' <summary>
''' 安装类型。有 installer、client、universal 三种。
''' </summary>
Public Category As String
Pigeon0v0 marked this conversation as resolved.
Show resolved Hide resolved
''' <summary>
''' 版本分支。若无分支则为 Nothing。
''' </summary>
Public Branch As String = Nothing
''' <summary>
''' 是否是 Beta 版。若未提供则默认为 False。
''' </summary>
Public IsBeta As Boolean = False
''' <summary>
''' 标准的版本号,如 “20.4.30”。
''' </summary>
Public StdVersion As String
Pigeon0v0 marked this conversation as resolved.
Show resolved Hide resolved
Public Structure DlNeoForgeListResult
''' <summary>
''' 数据来源名称,如“Official”,“BMCLAPI”。
''' </summary>
Public SourceName As String
''' <summary>
''' 是否为官方的实时数据。
''' </summary>
Public IsOfficial As Boolean
''' <summary>
''' 获取到的数据。
''' </summary>
Public Value As JObject
End Structure
''' <summary>
''' 是否为新版 NeoForge。(即为 Minecraft 1.13+)
''' </summary>
Public ReadOnly Property IsNewType As Boolean
Get
Return Version.Split(".")(0) >= 20
End Get
End Property
Pigeon0v0 marked this conversation as resolved.
Show resolved Hide resolved
''' <summary>
''' 构建数。
''' </summary>
Public ReadOnly Property Build As Integer
Get
Dim Version = Me.Version.Split(".")
If Version(0) < 15 Then
Return Version(Version.Count - 1)
Else
Return Version(Version.Count - 1) + 10000
End If
Pigeon0v0 marked this conversation as resolved.
Show resolved Hide resolved
End Get
End Property
''' <summary>
''' 用于下载的文件版本名。可能在 Version 的基础上添加了分支。
''' </summary>
Public ReadOnly Property FileVersion As String
Get
Return Version & If(Branch Is Nothing, "", "-" & Branch)
End Get
End Property
''' <summary>
''' 即将下载的文件全名。
''' </summary>
Public ReadOnly Property FileName As String
Get
If StdVersion.StartsWith("47.") Then 'NeoForge 1.20.1 的版本命名有些特殊...
Return "forge-" & Inherit & "-" & StdVersion & If(IsBeta, "-beta", "") & "-" & "installer" & "." & "jar"
Else
Return "neoforge-" & StdVersion & If(IsBeta, "-beta", "") & "-" & "installer" & "." & "jar"
End If
End Get
End Property
''' <summary>
''' 文件扩展名。
''' </summary>
Public FileSuffix As String = "jar"
Pigeon0v0 marked this conversation as resolved.
Show resolved Hide resolved
End Class
''' <summary>
''' NeoForge 版本列表,主加载器。
''' </summary>
Public DlNeoForgeListLoader As New LoaderTask(Of String, List(Of DlNeoForgeVersionEntry))("DlNeoForgeList Main", AddressOf DlNeoForgeVersionMain)
Public Sub DlNeoForgeVersionMain(Loader As LoaderTask(Of String, List(Of DlNeoForgeVersionEntry))) 'BMCLAPI 不会返回完整的 NeoForge 版本列表,而貌似也没有办法获取 NeoForge 支持的所有 Minecraft 版本
Dim DlNeoForgeVersionOfficialLoader As New LoaderTask(Of String, List(Of DlNeoForgeVersionEntry))("DlNeoForgeVersion Official", AddressOf DlNeoForgeVersionOfficialMain)
Dim DlNeoForgeVersionBmclapiLoader As New LoaderTask(Of String, List(Of DlNeoForgeVersionEntry))("DlNeoForgeVersion Bmclapi", AddressOf DlNeoForgeVersionBmclapiMain)
Select Case Setup.Get("ToolDownloadVersion")
Case 0
DlSourceLoader(Loader, New List(Of KeyValuePair(Of LoaderTask(Of String, List(Of DlNeoForgeVersionEntry)), Integer)) From {
New KeyValuePair(Of LoaderTask(Of String, List(Of DlNeoForgeVersionEntry)), Integer)(DlNeoForgeVersionBmclapiLoader, 30),
New KeyValuePair(Of LoaderTask(Of String, List(Of DlNeoForgeVersionEntry)), Integer)(DlNeoForgeVersionOfficialLoader, 60)
}, Loader.IsForceRestarting)
Case 1
DlSourceLoader(Loader, New List(Of KeyValuePair(Of LoaderTask(Of String, List(Of DlNeoForgeVersionEntry)), Integer)) From {
New KeyValuePair(Of LoaderTask(Of String, List(Of DlNeoForgeVersionEntry)), Integer)(DlNeoForgeVersionOfficialLoader, 5),
New KeyValuePair(Of LoaderTask(Of String, List(Of DlNeoForgeVersionEntry)), Integer)(DlNeoForgeVersionBmclapiLoader, 35)
}, Loader.IsForceRestarting)
Case Else
DlSourceLoader(Loader, New List(Of KeyValuePair(Of LoaderTask(Of String, List(Of DlNeoForgeVersionEntry)), Integer)) From {
New KeyValuePair(Of LoaderTask(Of String, List(Of DlNeoForgeVersionEntry)), Integer)(DlNeoForgeVersionOfficialLoader, 60),
New KeyValuePair(Of LoaderTask(Of String, List(Of DlNeoForgeVersionEntry)), Integer)(DlNeoForgeVersionBmclapiLoader, 60)
}, Loader.IsForceRestarting)
End Select
End Sub

''' <summary>
''' NeoForge 版本列表,官方源。
''' </summary>
Public Sub DlNeoForgeVersionOfficialMain(Loader As LoaderTask(Of String, List(Of DlNeoForgeVersionEntry)))
Dim Result As String
Dim ResultJson As JObject
Try
Result = NetGetCodeByDownload("https://maven.neoforged.net/api/maven/versions/releases/net/neoforged/neoforge", UseBrowserUserAgent:=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the link used here is the same as the one used by HMCL, but I can get the list just fine using HMCL.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个地址只会返回 1.20.1 以上的版本,并没有 1.20.1

1.20.1:https://maven.neoforged.net/api/maven/versions/releases/net/neoforged/forge

Catch ex As Exception
If GetExceptionSummary(ex).Contains("(404)") Then
Throw New Exception("没有可用版本")
Else
Throw
End If
End Try
If Result.Length < 50 Then Throw New Exception("获取到的版本列表长度不足(" & Result & ")")
ResultJson = GetJson(Result)
Dim Versions As New List(Of DlNeoForgeVersionEntry)
Dim VersionList As String = ResultJson("versions")
If Not Versions.Any() Then Throw New Exception("没有可用版本")
Loader.Output = Versions
End Sub

''' <summary>
''' NeoForge 版本列表,BMCLAPI。
''' </summary>
Public Sub DlNeoForgeVersionBmclapiMain(Loader As LoaderTask(Of String, List(Of DlNeoForgeVersionEntry)))
Dim Json As JArray = NetGetCodeByRequestRetry("https://bmclapi2.bangbang93.com/neoforge/list/" & Loader.Input, IsJson:=True)
Dim Versions As New List(Of DlNeoForgeVersionEntry)
Try
For Each Token As JObject In Json
Dim Name As String '存储 rawVersion,貌似变化更加频繁
Dim StdVersion As String '存储 version,相对规则
Dim IsBeta As Boolean
Dim rawVersion As String = Token("rawVersion")
If rawVersion.Contains("-beta") Then
StdVersion = Token("version").ToString().Replace("neoforge-", "").Replace("-beta", "").Replace("1.20.1-", "")
IsBeta = True
Else
StdVersion = Token("version").ToString().Replace("neoforge-", "").Replace("1.20.1-", "")
IsBeta = False
End If
Name = rawVersion
Dim Inherit As String = Token("mcversion")
Dim Entry = New DlNeoForgeVersionEntry With {.Version = Name, .Inherit = Inherit, .IsBeta = IsBeta, .StdVersion = StdVersion}
Versions.Add(Entry)
Next
Catch ex As Exception
MyMsgBox(ex.ToString(), "错误")
Throw New Exception("版本列表解析失败(" & Json.ToString & ")", ex)
End Try
If Not Versions.Any() Then Throw New Exception("没有可用版本")
Loader.Output = Versions
End Sub

#End Region

#Region "DlLiteLoaderList | LiteLoader 版本列表"

Public Structure DlLiteLoaderListResult
Expand Down
49 changes: 44 additions & 5 deletions Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.vb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Imports System.IO.Compression
Imports MS.Internal
Pigeon0v0 marked this conversation as resolved.
Show resolved Hide resolved

Public Module ModMinecraft

Expand Down Expand Up @@ -345,7 +346,7 @@ Public Module ModMinecraft
End If
Next
End If
'从 Forge Arguments 中获取版本号
'从 Forge / NeoForge Arguments 中获取版本号
If JsonObject("arguments") IsNot Nothing AndAlso JsonObject("arguments")("game") IsNot Nothing Then
Dim Mark As Boolean = False
For Each Argument In JsonObject("arguments")("game")
Expand Down Expand Up @@ -729,12 +730,20 @@ Recheck:
State = McVersionState.Fabric
Version.FabricVersion = If(RegexSeek(RealJson, "(?<=(net.fabricmc:fabric-loader:)|(org.quiltmc:quilt-loader:))[0-9\.]+(\+build.[0-9]+)?"), "未知版本").Replace("+build", "")
Version.HasFabric = True
ElseIf RealJson.Contains("minecraftforge") Then
ElseIf RealJson.Contains("minecraftforge") AndAlso Not RealJson.Contains("neoforge") Then
State = McVersionState.Forge
Version.ForgeVersion = RegexSeek(RealJson, "(?<=forge:[0-9\.]+(_pre[0-9]*)?\-)[0-9\.]+")
If Version.ForgeVersion Is Nothing Then Version.ForgeVersion = RegexSeek(RealJson, "(?<=net\.minecraftforge:minecraftforge:)[0-9\.]+")
If Version.ForgeVersion Is Nothing Then Version.ForgeVersion = If(RegexSeek(RealJson, "(?<=net\.minecraftforge:fmlloader:[0-9\.]+-)[0-9\.]+"), "未知版本")
Version.HasForge = True
ElseIf RealJson.Contains("neoforge") Then '1.20.1 NeoForge Json 内信息不同,为了方便直接截断 orgeVersion;这里的实现比较抽象,正则我写不会
LTCatt marked this conversation as resolved.
Show resolved Hide resolved
State = McVersionState.NeoForge '1.20.1 Json 标识:"--fml.forgeVersion" 1.20.1 以上 Json 标识:"--fml.neoForgeVersion"
Dim JsonStr1() As String = RealJson.Replace(" ", "").Split("orgeVersion""," & vbCrLf & """")
Dim JsonStr2() As String = JsonStr1(1).Split("""")
Version.NeoForgeVersion = JsonStr2(0)
If Version.NeoForgeVersion Is Nothing Then Version.NeoForgeVersion = RegexSeek(RealJson, "(?<=orgeVersion"",)[0-9\.]+")
If Version.NeoForgeVersion Is Nothing Then Version.NeoForgeVersion = If(RegexSeek(RealJson, "(?<=net\.minecraftforge:fmlloader:[0-9\.]+-)[0-9\.]+"), "未知版本")
Version.HasNeoForge = True
End If
Version.IsApiLoaded = True
End Select
Expand All @@ -752,6 +761,8 @@ ExitDataLoad:
Logo = PathImage & "Blocks/CobbleStone.png"
Case McVersionState.Forge
Logo = PathImage & "Blocks/Anvil.png"
Case McVersionState.NeoForge
Logo = PathImage & "Icons/NeoForged.png"
Pigeon0v0 marked this conversation as resolved.
Show resolved Hide resolved
Case McVersionState.Fabric
Logo = PathImage & "Blocks/Fabric.png"
Case McVersionState.OptiFine
Expand Down Expand Up @@ -780,7 +791,7 @@ ExitDataLoad:
End If
Case McVersionState.Old
Info = "远古版本"
Case McVersionState.Original, McVersionState.Forge, McVersionState.Fabric, McVersionState.OptiFine, McVersionState.LiteLoader
Case McVersionState.Original, McVersionState.Forge, McVersionState.NeoForge, McVersionState.Fabric, McVersionState.OptiFine, McVersionState.LiteLoader
Info = Version.ToString
Case McVersionState.Fool
Info = GetMcFoolName(Version.McName)
Expand Down Expand Up @@ -813,6 +824,7 @@ ExitDataLoad:
WriteIni(Path & "PCL\Setup.ini", "VersionOptiFine", Version.OptiFineVersion)
WriteIni(Path & "PCL\Setup.ini", "VersionLiteLoader", Version.HasLiteLoader)
WriteIni(Path & "PCL\Setup.ini", "VersionForge", Version.ForgeVersion)
WriteIni(Path & "PCL\Setup.ini", "VersionNeoForge", Version.NeoForgeVersion)
WriteIni(Path & "PCL\Setup.ini", "VersionApiCode", Version.SortCode)
WriteIni(Path & "PCL\Setup.ini", "VersionOriginal", Version.McName)
WriteIni(Path & "PCL\Setup.ini", "VersionOriginalMain", Version.McCodeMain)
Expand Down Expand Up @@ -852,6 +864,7 @@ ExitDataLoad:
OptiFine
Old
Forge
NeoForge
LiteLoader
Fabric
End Enum
Expand Down Expand Up @@ -903,6 +916,17 @@ ExitDataLoad:
''' </summary>
Public ForgeVersion As String = ""

'NeoForge

''' <summary>
''' 该版本是否安装了 NeoForge。
''' </summary>
Public HasNeoForge As Boolean = False
''' <summary>
''' NeoForge 版本号,如 31.1.2、14.23.5.2847。
''' </summary>
Public NeoForgeVersion As String = ""

'Fabric

''' <summary>
Expand All @@ -929,6 +953,7 @@ ExitDataLoad:
Public Overrides Function ToString() As String
ToString = ""
If HasForge Then ToString += ", Forge" & If(ForgeVersion = "未知版本", "", " " & ForgeVersion)
If HasNeoForge Then ToString += ", NeoForge" & If(NeoForgeVersion = "未知版本", "", " " & NeoForgeVersion)
If HasFabric Then ToString += ", Fabric" & If(FabricVersion = "未知版本", "", " " & FabricVersion)
If HasOptiFine Then ToString += ", OptiFine" & If(OptiFineVersion = "未知版本", "", " " & OptiFineVersion)
If HasLiteLoader Then ToString += ", LiteLoader"
Expand Down Expand Up @@ -965,6 +990,16 @@ ExitDataLoad:
Else
Throw New Exception("无效的 Forge 版本:" & ForgeVersion)
End If
ElseIf HasNeoForge Then
If NeoForgeVersion = "未知版本" Then Return 0
Dim SubVersions = NeoForgeVersion.Split(".")
If SubVersions.Length = 4 Then
_SortCode = Val(SubVersions(0)) * 1000000 + Val(SubVersions(1)) * 10000 + Val(SubVersions(3))
ElseIf SubVersions.Length = 3 Then
_SortCode = Val(SubVersions(0)) * 1000000 + Val(SubVersions(1)) * 10000 + Val(SubVersions(2))
Else
Throw New Exception("无效的 NeoForge 版本:" & NeoForgeVersion)
End If
Pigeon0v0 marked this conversation as resolved.
Show resolved Hide resolved
ElseIf HasOptiFine Then
If OptiFineVersion = "未知版本" Then Return 0
'由对应原版次级版本号(2 位)、字母(2 位)、末尾数字(2 位)、测试标记(2 位,正式版为 99,Pre[x] 为 50+x,Beta[x] 为 x)组成
Expand Down Expand Up @@ -1175,6 +1210,7 @@ OnLoaded:
Dim VersionInfo As New McVersionInfo With {
.FabricVersion = ReadIni(Version.Path & "PCL\Setup.ini", "VersionFabric", ""),
.ForgeVersion = ReadIni(Version.Path & "PCL\Setup.ini", "VersionForge", ""),
.NeoForgeVersion = ReadIni(Version.Path & "PCL\Setup.ini", "VersionNeoForge", ""),
.OptiFineVersion = ReadIni(Version.Path & "PCL\Setup.ini", "VersionOptiFine", ""),
.HasLiteLoader = ReadIni(Version.Path & "PCL\Setup.ini", "VersionLiteLoader", False),
.SortCode = ReadIni(Version.Path & "PCL\Setup.ini", "VersionApiCode", -1),
Expand All @@ -1185,6 +1221,7 @@ OnLoaded:
}
VersionInfo.HasFabric = VersionInfo.FabricVersion.Count > 1
VersionInfo.HasForge = VersionInfo.ForgeVersion.Count > 1
VersionInfo.HasNeoForge = VersionInfo.NeoForgeVersion.Count > 1
VersionInfo.HasOptiFine = VersionInfo.OptiFineVersion.Count > 1
Pigeon0v0 marked this conversation as resolved.
Show resolved Hide resolved
Version.Version = VersionInfo
End If
Expand Down Expand Up @@ -1273,7 +1310,7 @@ OnLoaded:
McVersionFilter(VersionList, VersionListOriginal, {McVersionState.Fool}, McVersionCardType.Fool)

'筛选 API 版本
McVersionFilter(VersionList, VersionListOriginal, {McVersionState.Forge, McVersionState.LiteLoader, McVersionState.Fabric}, McVersionCardType.API)
McVersionFilter(VersionList, VersionListOriginal, {McVersionState.Forge, McVersionState.NeoForge, McVersionState.LiteLoader, McVersionState.Fabric}, McVersionCardType.API)

'将老版本预先分类入不常用,只剩余原版、快照、OptiFine
Dim VersionUseful As New List(Of McVersion)
Expand Down Expand Up @@ -1407,7 +1444,7 @@ OnLoaded:
End Function)
End If

'API 版本:优先按版本排序,此后【先放 Fabric,再放 Forge(按版本号从高到低排序),最后放 LiteLoader(按名称排序)】
'API 版本:优先按版本排序,此后【先放 Fabric,再放 Forge,再放 NeoForge(按版本号从高到低排序),最后放 LiteLoader(按名称排序)】
If ResultVersionList.ContainsKey(McVersionCardType.API) Then
ResultVersionList(McVersionCardType.API) = Sort(ResultVersionList(McVersionCardType.API),
Function(Left As McVersion, Right As McVersion)
Expand All @@ -1419,6 +1456,8 @@ OnLoaded:
Return Left.Version.HasFabric
ElseIf Left.Version.HasForge Xor Right.Version.HasForge Then
Return Left.Version.HasForge
ElseIf Left.Version.HasNeoForge Xor Right.Version.HasNeoForge Then
Return Left.Version.HasNeoForge
ElseIf Not Left.Version.SortCode <> Right.Version.SortCode Then
Return Left.Version.SortCode > Right.Version.SortCode
Else
Expand Down
Loading