fix: Icon 显示及其导致的崩溃问题
fix: 1.20.1 NeoForge 下载链接拼接错误 fix: 自动安装界面选择 NeoForge 后使用了 rawVersion 作为版本号
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -771,7 +771,7 @@
|
|||||||
Public Value As JObject
|
Public Value As JObject
|
||||||
End Structure
|
End Structure
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' 是否为新版 Forge。(即为 Minecraft 1.13+)
|
''' 是否为新版 NeoForge。(即为 Minecraft 1.13+)
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property IsNewType As Boolean
|
Public ReadOnly Property IsNewType As Boolean
|
||||||
Get
|
Get
|
||||||
@@ -804,21 +804,17 @@
|
|||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property FileName As String
|
Public ReadOnly Property FileName As String
|
||||||
Get
|
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"
|
Return "neoforge-" & StdVersion & If(IsBeta, "-beta", "") & "-" & "installer" & "." & "jar"
|
||||||
|
End If
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' 文件扩展名。
|
''' 文件扩展名。
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public ReadOnly Property FileSuffix As String
|
Public FileSuffix As String = "jar"
|
||||||
Get
|
|
||||||
If Category = "installer" Then
|
|
||||||
Return "jar"
|
|
||||||
Else
|
|
||||||
Return "jar"
|
|
||||||
End If
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
End Class
|
End Class
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' NeoForge 版本列表,主加载器。
|
''' NeoForge 版本列表,主加载器。
|
||||||
@@ -882,10 +878,10 @@
|
|||||||
Dim IsBeta As Boolean
|
Dim IsBeta As Boolean
|
||||||
Dim rawVersion As String = Token("rawVersion")
|
Dim rawVersion As String = Token("rawVersion")
|
||||||
If rawVersion.Contains("-beta") Then
|
If rawVersion.Contains("-beta") Then
|
||||||
StdVersion = Token("version").ToString().Replace("neoforge-", "").Replace("-beta", "")
|
StdVersion = Token("version").ToString().Replace("neoforge-", "").Replace("-beta", "").Replace("1.20.1-", "")
|
||||||
IsBeta = True
|
IsBeta = True
|
||||||
Else
|
Else
|
||||||
StdVersion = Token("version").ToString().Replace("neoforge-", "")
|
StdVersion = Token("version").ToString().Replace("neoforge-", "").Replace("1.20.1-", "")
|
||||||
IsBeta = False
|
IsBeta = False
|
||||||
End If
|
End If
|
||||||
Name = rawVersion
|
Name = rawVersion
|
||||||
|
|||||||
@@ -736,12 +736,12 @@ Recheck:
|
|||||||
If Version.ForgeVersion Is Nothing Then Version.ForgeVersion = RegexSeek(RealJson, "(?<=net\.minecraftforge:minecraftforge:)[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\.]+"), "未知版本")
|
If Version.ForgeVersion Is Nothing Then Version.ForgeVersion = If(RegexSeek(RealJson, "(?<=net\.minecraftforge:fmlloader:[0-9\.]+-)[0-9\.]+"), "未知版本")
|
||||||
Version.HasForge = True
|
Version.HasForge = True
|
||||||
ElseIf RealJson.Contains("neoforge") Then
|
ElseIf RealJson.Contains("neoforge") Then '1.20.1 NeoForge Json 内信息不同,为了方便直接截断 orgeVersion;这里的实现比较抽象,正则我写不会
|
||||||
State = McVersionState.NeoForge
|
State = McVersionState.NeoForge '1.20.1 Json 标识:"--fml.forgeVersion" 1.20.1 以上 Json 标识:"--fml.neoForgeVersion"
|
||||||
Dim JsonStr1() As String = RealJson.Replace(" ", "").Split("""--fml.neoForgeVersion""," & vbCrLf & """") '这里的实现比较抽象,正则我写不会
|
Dim JsonStr1() As String = RealJson.Replace(" ", "").Split("orgeVersion""," & vbCrLf & """")
|
||||||
Dim JsonStr2() As String = JsonStr1(1).Split("""")
|
Dim JsonStr2() As String = JsonStr1(1).Split("""")
|
||||||
Version.NeoForgeVersion = JsonStr2(0)
|
Version.NeoForgeVersion = JsonStr2(0)
|
||||||
If Version.NeoForgeVersion Is Nothing Then Version.NeoForgeVersion = RegexSeek(RealJson, "(?<=""--fml.neoForgeVersion"",)[0-9\.]+")
|
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\.]+"), "未知版本")
|
If Version.NeoForgeVersion Is Nothing Then Version.NeoForgeVersion = If(RegexSeek(RealJson, "(?<=net\.minecraftforge:fmlloader:[0-9\.]+-)[0-9\.]+"), "未知版本")
|
||||||
Version.HasNeoForge = True
|
Version.HasNeoForge = True
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -1782,10 +1782,17 @@ Retry:
|
|||||||
Loaders.Add(New LoaderTask(Of DlNeoForgeVersionEntry, List(Of NetFile))("获取下载地址",
|
Loaders.Add(New LoaderTask(Of DlNeoForgeVersionEntry, List(Of NetFile))("获取下载地址",
|
||||||
Sub(Task As LoaderTask(Of DlNeoForgeVersionEntry, List(Of NetFile)))
|
Sub(Task As LoaderTask(Of DlNeoForgeVersionEntry, List(Of NetFile)))
|
||||||
Dim Files As New List(Of NetFile)
|
Dim Files As New List(Of NetFile)
|
||||||
|
If DownloadInfo.StdVersion.StartsWith("47.") Then '1.20.1 NeoForge 下载地址不同
|
||||||
Files.Add(New NetFile({
|
Files.Add(New NetFile({
|
||||||
"https://bmclapi2.bangbang93.com/maven/net/neoforged/neoforge/" & DownloadInfo.StdVersion & "/" & DownloadInfo.FileName,
|
"https://bmclapi2.bangbang93.com/maven/net/neoforged/forge/" & "1.20.1-" & DownloadInfo.StdVersion & If(DownloadInfo.IsBeta, "-beta", "") & "/" & DownloadInfo.FileName,
|
||||||
"https://maven.neoforged.net/releases/net/neoforged/neoforge/" & DownloadInfo.StdVersion & "/" & DownloadInfo.FileName
|
"https://maven.neoforged.net/releases/net/neoforged/forge/" & "1.20.1-" & DownloadInfo.StdVersion & If(DownloadInfo.IsBeta, "-beta", "") & "/" & DownloadInfo.FileName
|
||||||
}, Target, New FileChecker(MinSize:=64 * 1024, Hash:=DownloadInfo.Hash)))
|
}, Target, New FileChecker(MinSize:=64 * 1024, Hash:=DownloadInfo.Hash)))
|
||||||
|
Else
|
||||||
|
Files.Add(New NetFile({
|
||||||
|
"https://bmclapi2.bangbang93.com/maven/net/neoforged/neoforge/" & DownloadInfo.StdVersion & If(DownloadInfo.IsBeta, "-beta", "") & "/" & DownloadInfo.FileName,
|
||||||
|
"https://maven.neoforged.net/releases/net/neoforged/neoforge/" & DownloadInfo.StdVersion & If(DownloadInfo.IsBeta, "-beta", "") & "/" & DownloadInfo.FileName
|
||||||
|
}, Target, New FileChecker(MinSize:=64 * 1024, Hash:=DownloadInfo.Hash)))
|
||||||
|
End If
|
||||||
Task.Output = Files
|
Task.Output = Files
|
||||||
End Sub) With {.ProgressWeight = 0.1, .Show = False})
|
End Sub) With {.ProgressWeight = 0.1, .Show = False})
|
||||||
'下载
|
'下载
|
||||||
@@ -2005,11 +2012,20 @@ Retry:
|
|||||||
If IsCustomFolder Then Throw New Exception("如果没有指定原版下载器,则不能指定 MC 安装文件夹")
|
If IsCustomFolder Then Throw New Exception("如果没有指定原版下载器,则不能指定 MC 安装文件夹")
|
||||||
ClientDownloadLoader = McDownloadClient(NetPreDownloadBehaviour.ExitWhileExistsOrDownloading, Inherit)
|
ClientDownloadLoader = McDownloadClient(NetPreDownloadBehaviour.ExitWhileExistsOrDownloading, Inherit)
|
||||||
End If
|
End If
|
||||||
'添加主文件
|
Dim Files
|
||||||
Dim Files As New List(Of NetFile) From {New NetFile({
|
If DownloadInfo.StdVersion.StartsWith("47.") Then '1.20.1 NeoForge 下载地址不同
|
||||||
|
Dim FilesLegacy As New List(Of NetFile) From {New NetFile({
|
||||||
|
"https://bmclapi2.bangbang93.com/maven/net/neoforged/forge/" & "1.20.1-" & DownloadInfo.StdVersion & If(DownloadInfo.IsBeta, "-beta", "") & "/" & DownloadInfo.FileName,
|
||||||
|
"https://maven.neoforged.net/releases/net/neoforged/forge/" & "1.20.1-" & DownloadInfo.StdVersion & If(DownloadInfo.IsBeta, "-beta", "") & "/" & DownloadInfo.FileName
|
||||||
|
}, InstallerAddress, New FileChecker(MinSize:=64 * 1024, Hash:=DownloadInfo.Hash))}
|
||||||
|
Files = FilesLegacy
|
||||||
|
Else
|
||||||
|
Dim FilesLatest As New List(Of NetFile) From {New NetFile({
|
||||||
"https://bmclapi2.bangbang93.com/maven/net/neoforged/neoforge/" & DownloadInfo.StdVersion & If(DownloadInfo.IsBeta, "-beta", "") & "/" & DownloadInfo.FileName,
|
"https://bmclapi2.bangbang93.com/maven/net/neoforged/neoforge/" & DownloadInfo.StdVersion & If(DownloadInfo.IsBeta, "-beta", "") & "/" & DownloadInfo.FileName,
|
||||||
"https://maven.neoforged.net/releases/net/neoforged/neoforge/" & DownloadInfo.StdVersion & If(DownloadInfo.IsBeta, "-beta", "") & "/" & DownloadInfo.FileName
|
"https://maven.neoforged.net/releases/net/neoforged/neoforge/" & DownloadInfo.StdVersion & If(DownloadInfo.IsBeta, "-beta", "") & "/" & DownloadInfo.FileName
|
||||||
}, InstallerAddress, New FileChecker(MinSize:=64 * 1024, Hash:=DownloadInfo.Hash))}
|
}, InstallerAddress, New FileChecker(MinSize:=64 * 1024, Hash:=DownloadInfo.Hash))}
|
||||||
|
Files = FilesLatest
|
||||||
|
End If
|
||||||
Task.Output = Files
|
Task.Output = Files
|
||||||
End Sub) With {.ProgressWeight = 0.5, .Show = False})
|
End Sub) With {.ProgressWeight = 0.5, .Show = False})
|
||||||
Loaders.Add(New LoaderDownload("下载 Mod 加载器主文件", New List(Of NetFile)) With {.ProgressWeight = 9})
|
Loaders.Add(New LoaderDownload("下载 Mod 加载器主文件", New List(Of NetFile)) With {.ProgressWeight = 9})
|
||||||
@@ -2196,7 +2212,7 @@ Retry:
|
|||||||
If(Entry.ReleaseTime = "",
|
If(Entry.ReleaseTime = "",
|
||||||
If(ModeDebug, If(Entry.Category IsNot Nothing, "种类:" & Entry.Category, "") & If(Entry.Branch Is Nothing, "", ",开发分支:" & Entry.Branch), ""),
|
If(ModeDebug, If(Entry.Category IsNot Nothing, "种类:" & Entry.Category, "") & If(Entry.Branch Is Nothing, "", ",开发分支:" & Entry.Branch), ""),
|
||||||
"发布于 " & Entry.ReleaseTime & If(ModeDebug, ",种类:" & Entry.Category & If(Entry.Branch Is Nothing, "", ",开发分支:" & Entry.Branch), "")),
|
"发布于 " & Entry.ReleaseTime & If(ModeDebug, ",种类:" & Entry.Category & If(Entry.Branch Is Nothing, "", ",开发分支:" & Entry.Branch), "")),
|
||||||
.Logo = PathImage & "Blocks/NeoForge.png"
|
.Logo = PathImage & "Icons/NeoForged.png"
|
||||||
}
|
}
|
||||||
AddHandler NewItem.Click, OnClick
|
AddHandler NewItem.Click, OnClick
|
||||||
'建立菜单
|
'建立菜单
|
||||||
|
|||||||
@@ -89,7 +89,7 @@
|
|||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="1*" />
|
<ColumnDefinition Width="1*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Image x:Name="ImgNeoForge" Margin="0,0,7,0" SnapsToDevicePixels="True" Height="18" RenderOptions.BitmapScalingMode="Linear" Source="pack://application:,,,/images/Blocks/NeoForge.png" />
|
<Image x:Name="ImgNeoForge" Margin="0,0,7,0" SnapsToDevicePixels="True" Height="18" RenderOptions.BitmapScalingMode="Linear" Source="pack://application:,,,/images/Icons/NeoForged.png" />
|
||||||
<TextBlock x:Name="LabNeoForge" VerticalAlignment="Center" TextTrimming="CharacterEllipsis" Grid.Column="1" />
|
<TextBlock x:Name="LabNeoForge" VerticalAlignment="Center" TextTrimming="CharacterEllipsis" Grid.Column="1" />
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid x:Name="BtnNeoForgeClear" Height="30" Width="30" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,5,32,0" Background="{StaticResource ColorBrushSemiTransparent}">
|
<Grid x:Name="BtnNeoForgeClear" Height="30" Width="30" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,5,32,0" Background="{StaticResource ColorBrushSemiTransparent}">
|
||||||
|
|||||||
@@ -384,7 +384,7 @@
|
|||||||
Else
|
Else
|
||||||
BtnNeoForgeClear.Visibility = Visibility.Visible
|
BtnNeoForgeClear.Visibility = Visibility.Visible
|
||||||
ImgNeoForge.Visibility = Visibility.Visible
|
ImgNeoForge.Visibility = Visibility.Visible
|
||||||
LabNeoForge.Text = SelectedNeoForge.Version
|
LabNeoForge.Text = SelectedNeoForge.StdVersion & If(SelectedNeoForge.IsBeta, "-beta", "")
|
||||||
LabNeoForge.Foreground = ColorGray1
|
LabNeoForge.Foreground = ColorGray1
|
||||||
End If
|
End If
|
||||||
'Fabric
|
'Fabric
|
||||||
@@ -541,7 +541,7 @@
|
|||||||
ElseIf SelectedForge IsNot Nothing Then
|
ElseIf SelectedForge IsNot Nothing Then
|
||||||
Return "pack://application:,,,/images/Blocks/Anvil.png"
|
Return "pack://application:,,,/images/Blocks/Anvil.png"
|
||||||
ElseIf SelectedNeoForge IsNot Nothing Then
|
ElseIf SelectedNeoForge IsNot Nothing Then
|
||||||
Return "pack://application:,,,/images/Blocks/NeoForge.png"
|
Return "pack://application:,,,/images/Icons/NeoForged.png"
|
||||||
ElseIf SelectedLiteLoader IsNot Nothing Then
|
ElseIf SelectedLiteLoader IsNot Nothing Then
|
||||||
Return "pack://application:,,,/images/Blocks/Egg.png"
|
Return "pack://application:,,,/images/Blocks/Egg.png"
|
||||||
ElseIf SelectedOptiFine IsNot Nothing Then
|
ElseIf SelectedOptiFine IsNot Nothing Then
|
||||||
|
|||||||
@@ -757,7 +757,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Images\Blocks\Anvil.png" />
|
<Resource Include="Images\Blocks\Anvil.png" />
|
||||||
<Resource Include="Images\Blocks\NeoForge.png" />
|
|
||||||
<Resource Include="Images\Blocks\CobbleStone.png" />
|
<Resource Include="Images\Blocks\CobbleStone.png" />
|
||||||
<Resource Include="Images\Blocks\CommandBlock.png" />
|
<Resource Include="Images\Blocks\CommandBlock.png" />
|
||||||
<Resource Include="Images\Blocks\Grass.png" />
|
<Resource Include="Images\Blocks\Grass.png" />
|
||||||
@@ -924,6 +923,8 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Images\Heads\MCBBS.png" />
|
<Resource Include="Images\Heads\MCBBS.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup />
|
<ItemGroup>
|
||||||
|
<Resource Include="Images\Icons\NeoForged.png" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
Reference in New Issue
Block a user