From c2b282c8dbbd50ffd4a132649839e075b726d8a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E7=8C=AB=E8=B7=83?= <1043137532@qq.com> Date: Fri, 27 Jan 2023 01:11:26 +0800 Subject: [PATCH] 2.4.7 --- Plain Craft Launcher 2/FormMain.xaml.vb | 6 +++++- Plain Craft Launcher 2/Modules/Base/ModBase.vb | 6 +++--- .../Modules/Minecraft/ModMinecraft.vb | 8 ++++---- Plain Craft Launcher 2/Modules/ModMusic.vb | 18 +++++++++--------- .../My Project/AssemblyInfo.vb | 4 ++-- 5 files changed, 23 insertions(+), 19 deletions(-) diff --git a/Plain Craft Launcher 2/FormMain.xaml.vb b/Plain Craft Launcher 2/FormMain.xaml.vb index 8b98606..0da0787 100644 --- a/Plain Craft Launcher 2/FormMain.xaml.vb +++ b/Plain Craft Launcher 2/FormMain.xaml.vb @@ -10,7 +10,7 @@ Public Class FormMain Dim FeatureList As New List(Of KeyValuePair(Of Integer, String)) '统计更新日志条目 #If BETA Then - If LastVersion < 276 Then 'Release 2.4.6 + If LastVersion < 276 Then 'Release 2.4.7 FeatureList.Add(New KeyValuePair(Of Integer, String)(4, "增加 在游戏启动前执行命令 设置")) FeatureList.Add(New KeyValuePair(Of Integer, String)(3, "在百宝箱添加了清理 MC 日志、崩溃报告的按钮")) FeatureList.Add(New KeyValuePair(Of Integer, String)(2, "优化界面动画,修改部分配色")) @@ -117,6 +117,10 @@ Public Class FormMain '3:BUG+ IMP* FEAT- '2:BUG* IMP- '1:BUG- + If LastVersion < 278 Then 'Snapshot 2.4.7 + If LastVersion = 277 Then FeatureList.Add(New KeyValuePair(Of Integer, String)(1, "修复设置背景音乐可能导致无法启动 PCL 的 Bug")) + BugCount += 2 + End If If LastVersion < 277 Then 'Snapshot 2.4.6 FeatureList.Add(New KeyValuePair(Of Integer, String)(3, "在百宝箱添加了清理 MC 日志、崩溃报告的按钮")) FeatureCount += 8 diff --git a/Plain Craft Launcher 2/Modules/Base/ModBase.vb b/Plain Craft Launcher 2/Modules/Base/ModBase.vb index 61d8c4c..b590424 100644 --- a/Plain Craft Launcher 2/Modules/Base/ModBase.vb +++ b/Plain Craft Launcher 2/Modules/Base/ModBase.vb @@ -10,12 +10,12 @@ Public Module ModBase #Region "声明" '下列版本信息由更新器自动修改 - Public Const VersionBaseName As String = "2.4.6" '不含分支前缀的显示用版本名 - Public Const VersionStandardCode As String = "2.4.6." & VersionBranchCode '标准格式的四段式版本号 + Public Const VersionBaseName As String = "2.4.7" '不含分支前缀的显示用版本名 + Public Const VersionStandardCode As String = "2.4.7." & VersionBranchCode '标准格式的四段式版本号 #If BETA Then Public Const VersionCode As Integer = 276 'Release #Else - Public Const VersionCode As Integer = 277 'Snapshot + Public Const VersionCode As Integer = 278 'Snapshot #End If '自动生成的版本信息 Public Const VersionDisplayName As String = VersionBranchName & " " & VersionBaseName diff --git a/Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.vb b/Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.vb index 0bff379..62f62e3 100644 --- a/Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.vb +++ b/Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.vb @@ -6,7 +6,7 @@ Public Module ModMinecraft '列表初始化 - Public JavaListCacheVersion As Integer = 1 + Public JavaListCacheVersion As Integer = 2 ''' ''' 目前所有可用的 Java。 ''' @@ -175,10 +175,11 @@ Public Module ModMinecraft End If Is64Bit = Output.Contains("64-bit") If Version.Minor <= 4 OrElse Version.Minor >= 25 Then Throw New Exception("分析详细信息失败,获取的版本为 " & Version.ToString) + '无论如何不允许使用 JRE 16,它完全是炸的,安 OptiFine、Forge 和启动 MC 都会炸 + If IsJre AndAlso VersionCode = 16 Then Throw New Exception("由于 JRE 16 对 Minecraft 的兼容性很差,因此不再允许使用") Catch ex As Exception Log("[Java] 检查失败的 Java 输出:" & PathFolder & "java.exe" & vbCrLf & If(Output, "无程序输出")) - ex = New Exception("检查 Java 详细信息失败(" & If(PathJavaw, "Nothing") & ")", ex) - Throw ex + Throw New Exception("检查 Java 失败(" & If(PathJavaw, "Nothing") & ")", ex) End Try IsChecked = True End Sub @@ -457,7 +458,6 @@ RetryGet: If MinVersion IsNot Nothing AndAlso Java.Version < MinVersion Then Continue For If MaxVersion IsNot Nothing AndAlso Java.Version > MaxVersion Then Continue For If Java.Is64Bit AndAlso Is32BitSystem Then Continue For - If Java.IsJre AndAlso Java.VersionCode >= 12 Then Continue For '无论如何不允许使用 JRE 12+,它们完全是炸的,安 OptiFine、Forge 和启动 MC 都会炸 AllowedJavaList.Add(Java) Next diff --git a/Plain Craft Launcher 2/Modules/ModMusic.vb b/Plain Craft Launcher 2/Modules/ModMusic.vb index 2dbb31e..677edc0 100644 --- a/Plain Craft Launcher 2/Modules/ModMusic.vb +++ b/Plain Craft Launcher 2/Modules/ModMusic.vb @@ -187,7 +187,8 @@ ''' Private Sub MusicStartPlay(Address As String, Optional IsFirstLoad As Boolean = False) Log("[Music] 播放开始:" & Address) - RunInNewThread(Sub() MusicLoop(Address, IsFirstLoad), "Music", ThreadPriority.BelowNormal) + MusicCurrent = Address + RunInNewThread(Sub() MusicLoop(IsFirstLoad), "Music", ThreadPriority.BelowNormal) End Sub '播放与暂停 @@ -237,15 +238,14 @@ ''' ''' 在 MusicUuid 不变的前提下,持续播放某地址的音乐,且在播放结束后随机播放下一曲。 ''' - Private Sub MusicLoop(Address As String, Optional IsFirstLoad As Boolean = False) - MusicCurrent = Address + Private Sub MusicLoop(Optional IsFirstLoad As Boolean = False) Dim CurrentWave As NAudio.Wave.WaveOut = Nothing Dim Reader As NAudio.Wave.WaveStream = Nothing Try '开始播放 CurrentWave = New NAudio.Wave.WaveOut() MusicNAudio = CurrentWave - Reader = New NAudio.Wave.AudioFileReader(Address) + Reader = New NAudio.Wave.AudioFileReader(MusicCurrent) CurrentWave.Init(Reader) CurrentWave.Play() '第一次打开的暂停 @@ -265,13 +265,13 @@ If CurrentWave.PlaybackState = NAudio.Wave.PlaybackState.Stopped AndAlso MusicAllList.Count > 0 Then MusicStartPlay(DequeueNextMusicAddress) Catch ex As Exception If ex.Message.Contains("Got a frame at sample rate") OrElse ex.Message.Contains("does not support changes to") Then - Hint("播放音乐失败(" & GetFileNameFromPath(Address) & "):PCL2 不支持播放音频属性在中途发生变化的音乐", HintType.Critical) - ElseIf Not (Address.ToLower.EndsWith(".wav") OrElse Address.ToLower.EndsWith(".mp3") OrElse Address.ToLower.EndsWith(".flac")) Then - Hint("播放音乐失败(" & GetFileNameFromPath(Address) & "):PCL2 可能不支持此音乐格式,请将格式转换为 .wav、.mp3 或 .flac 后再试", HintType.Critical) + Hint("播放音乐失败(" & GetFileNameFromPath(MusicCurrent) & "):PCL2 不支持播放音频属性在中途发生变化的音乐", HintType.Critical) + ElseIf Not (MusicCurrent.ToLower.EndsWith(".wav") OrElse MusicCurrent.ToLower.EndsWith(".mp3") OrElse MusicCurrent.ToLower.EndsWith(".flac")) Then + Hint("播放音乐失败(" & GetFileNameFromPath(MusicCurrent) & "):PCL2 可能不支持此音乐格式,请将格式转换为 .wav、.mp3 或 .flac 后再试", HintType.Critical) Else - Log(ex, "播放音乐失败(" & GetFileNameFromPath(Address) & ")", LogLevel.Hint) + Log(ex, "播放音乐失败(" & GetFileNameFromPath(MusicCurrent) & ")", LogLevel.Hint) End If - Log(ex, "播放音乐失败(" & Address & ")", LogLevel.Developer) + Log(ex, "播放音乐失败(" & MusicCurrent & ")", LogLevel.Developer) If MusicAllList.Count > 1 Then Thread.Sleep(1000) MusicStartPlay(DequeueNextMusicAddress) diff --git a/Plain Craft Launcher 2/My Project/AssemblyInfo.vb b/Plain Craft Launcher 2/My Project/AssemblyInfo.vb index 62dbd42..55ed05c 100644 --- a/Plain Craft Launcher 2/My Project/AssemblyInfo.vb +++ b/Plain Craft Launcher 2/My Project/AssemblyInfo.vb @@ -51,6 +51,6 @@ Imports System.Runtime.InteropServices ' 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 ' 方法是按如下所示使用“*” - - + +