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

支持 unlisted-versions-of-minecraft #4555

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d7c4b5d
支持 unlisted-versions-of-minecraft
zkitefly Aug 20, 2024
558cdcb
update
zkitefly Aug 20, 2024
db3530d
update
zkitefly Aug 20, 2024
802a223
update
zkitefly Aug 20, 2024
7832a8c
修改筛选器
zkitefly Aug 20, 2024
f8b045a
Fix
zkitefly Aug 20, 2024
e5a81b5
修复 2.0 的愚人节版本分类
zkitefly Aug 20, 2024
e28513a
Update Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.vb
zkitefly Aug 20, 2024
9c5d2f0
修复标签为 pending 时错误分类的问题
zkitefly Aug 20, 2024
fae7b56
gitcode.com 不要多线程
zkitefly Aug 20, 2024
3917adc
Merge branch 'uvmc' of https://github.com/zkitefly/PCL2 into uvmc
zkitefly Aug 20, 2024
8411bbd
Fix
zkitefly Aug 20, 2024
fddf519
Fix
zkitefly Aug 20, 2024
ad797b6
Uvmc test (#1)
zkitefly Aug 20, 2024
a81b321
point -> .
zkitefly Aug 20, 2024
76d0f01
Uvmc test (#2)
zkitefly Aug 29, 2024
f4fb085
Update ModMinecraft.vb
zkitefly Aug 31, 2024
c4b59de
防止误判
zkitefly Aug 31, 2024
7965ca8
Update ModDownload.vb
zkitefly Aug 31, 2024
72357c7
Merge remote-tracking branch 'upstream/main' into uvmc
zkitefly Sep 21, 2024
79005a1
Update ModDownload.vb
zkitefly Sep 21, 2024
3491e4e
Update Plain Craft Launcher 2/Modules/Minecraft/ModDownload.vb
zkitefly Sep 21, 2024
499dba5
Update Plain Craft Launcher 2/Modules/Minecraft/ModDownload.vb
zkitefly Sep 21, 2024
4561a71
Update ModDownload.vb
zkitefly Sep 21, 2024
290bee7
Merge branch 'main' into uvmc
zkitefly Oct 25, 2024
7f1de5d
Update Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.vb
zkitefly Oct 25, 2024
ae87513
Update Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.vb
zkitefly Oct 26, 2024
3e86c84
Update Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.vb
zkitefly Oct 27, 2024
5a9cd80
Update ModMinecraft.vb
zkitefly Nov 9, 2024
17863d5
update link
zkitefly Nov 22, 2024
72ebd5f
update download list type
zkitefly Nov 22, 2024
5fc5133
Merge branch 'main' into uvmc
zkitefly Nov 22, 2024
e68b0d1
Update ModNet.vb
zkitefly Nov 22, 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
2 changes: 1 addition & 1 deletion Plain Craft Launcher 2/Modules/Base/ModNet.vb
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ Capture:
Next
'是否禁用多线程,以及规定碎片大小
Dim TargetUrl As String = GetSource().Url
If TargetUrl.Contains("pcl2-server") OrElse TargetUrl.Contains("gitcode.net") OrElse TargetUrl.Contains("github.com") OrElse TargetUrl.Contains("modrinth") Then Return Nothing
If TargetUrl.Contains("pcl2-server") OrElse TargetUrl.Contains("gitcode") OrElse TargetUrl.Contains("github.com") OrElse TargetUrl.Contains("modrinth") Then Return Nothing
'寻找最大碎片
'FUTURE: 下载引擎重做,计算下载源平均链接时间和线程下载速度,按最高时间节省来开启多线程
Dim FilePieceMax As NetThread = Threads
Expand Down
25 changes: 20 additions & 5 deletions Plain Craft Launcher 2/Modules/Minecraft/ModDownload.vb
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,15 @@
Try
Dim Versions As JArray = Json("versions")
If Versions.Count < 200 Then Throw New Exception("获取到的版本列表长度不足(" & Json.ToString & ")")
'添加 PCL 特供项
If File.Exists(PathTemp & "Cache\download.json") Then Versions.Merge(GetJson(ReadFile(PathTemp & "Cache\download.json")))
'从指定URL获取并添加未列出的版本
Dim UnlistedJson As JObject = NetGetCodeByRequestRetry("https://zkitefly.github.io/unlisted-versions-of-minecraft/version_manifest.json", IsJson:=True)
' 替换 "pending" 为 "snapshot"
For Each versionm As JObject In UnlistedJson("versions")
If versionm("type").ToString() = "pending" Then
versionm("type") = "snapshot"
End If
Next
Versions.Merge(UnlistedJson("versions"))
'返回
Loader.Output = New DlClientListResult With {.IsOfficial = True, .SourceName = "Mojang 官方源", .Value = Json}
'解析更新提示(Release)
Expand Down Expand Up @@ -236,8 +243,15 @@
Try
Dim Versions As JArray = Json("versions")
If Versions.Count < 200 Then Throw New Exception("获取到的版本列表长度不足(" & Json.ToString & ")")
'添加 PCL 特供项
If File.Exists(PathTemp & "Cache\download.json") Then Versions.Merge(GetJson(ReadFile(PathTemp & "Cache\download.json")))
'从指定URL获取并添加未列出的版本
Dim UnlistedJson As JObject = NetGetCodeByRequestRetry("https://raw.gitcode.com/zkitefly/unlisted-versions-of-minecraft/raw/main/version_manifest.json", IsJson:=True)
' 替换 "pending" 为 "snapshot"
For Each versionb As JObject In UnlistedJson("versions")
If versionb("type").ToString() = "pending" Then
versionb("type") = "snapshot"
End If
Next
Versions.Merge(UnlistedJson("versions"))
'返回
Loader.Output = New DlClientListResult With {.IsOfficial = False, .SourceName = "BMCLAPI", .Value = Json}
Catch ex As Exception
Expand Down Expand Up @@ -1195,7 +1209,8 @@
Replace("https://piston-data.mojang.com", "https://bmclapi2.bangbang93.com").
Replace("https://piston-meta.mojang.com", "https://bmclapi2.bangbang93.com").
Replace("https://launcher.mojang.com", "https://bmclapi2.bangbang93.com").
Replace("https://launchermeta.mojang.com", "https://bmclapi2.bangbang93.com"),
Replace("https://launchermeta.mojang.com", "https://bmclapi2.bangbang93.com").
Replace("https://zkitefly.github.io/unlisted-versions-of-minecraft", "https://raw.gitcode.com/zkitefly/unlisted-versions-of-minecraft/raw/main"),
zkitefly marked this conversation as resolved.
Show resolved Hide resolved
Original
}
End Function
Expand Down
12 changes: 10 additions & 2 deletions Plain Craft Launcher 2/Modules/Minecraft/ModMinecraft.vb
Original file line number Diff line number Diff line change
Expand Up @@ -1029,8 +1029,16 @@ ExitDataLoad:
''' </summary>
Public Function GetMcFoolName(Name As String) As String
Name = Name.ToLower
If Name.StartsWithF("2.0") Then
Return "这个秘密计划了两年的更新将游戏推向了一个新高度!"
If Name.StartsWith("2.0") OrElse Name.StartsWith("2point0") Then
Dim Teg = ""
zkitefly marked this conversation as resolved.
Show resolved Hide resolved
If Name.StartsWith("red") Then
zkitefly marked this conversation as resolved.
Show resolved Hide resolved
Teg = "(红色版本)"
ElseIf Name.StartsWith("blue") Then
Teg = "(蓝色版本)"
ElseIf Name.StartsWith("purple") Then
Teg = "(紫色版本)"
End If
Return Teg & "这个秘密计划了两年的更新将游戏推向了一个新高度!"
ElseIf Name.StartsWithF("20w14inf") OrElse Name = "20w14∞" Then
Return "我们加入了 20 亿个新的维度,让无限的想象变成了现实!"
ElseIf Name = "15w14a" Then
Expand Down
32 changes: 18 additions & 14 deletions Plain Craft Launcher 2/Pages/PageDownload/ModDownloadLib.vb
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Public Module ModDownloadLib
Else
NewItem.Info = Entry("lore").ToString
End If
If Entry("url").ToString.Contains("pcl") Then NewItem.Info = "[PCL 特供下载] " & NewItem.Info
If Entry("url").ToString.Contains("unlisted-versions-of-minecraft") Then NewItem.Info = "[UVMC 特供下载] " & NewItem.Info
zkitefly marked this conversation as resolved.
Show resolved Hide resolved
AddHandler NewItem.Click, OnClick
'建立菜单
If IsSaveOnly Then
Expand Down Expand Up @@ -253,7 +253,7 @@ Public Module ModDownloadLib
Dim Id As String = VersionJson("id").ToString.ToLower
If Id = "3d shareware v1.34" Then
WikiName = "3D_Shareware_v1.34"
ElseIf Id = "2.0" Then
ElseIf Id = "2.0" OrElse Id.StartsWithF("2point0") Then
WikiName = "Java版2.0"
ElseIf Id = "1.rv-pre1" Then
WikiName = "Java版1.RV-Pre1"
Expand All @@ -279,24 +279,28 @@ Public Module ModDownloadLib
WikiName = "Java版RC2"
ElseIf Id.StartsWithF("1.19_deep_dark_experimental_snapshot-") OrElse Id.StartsWithF("1_19_deep_dark_experimental_snapshot-") Then
WikiName = Id.Replace("1_19", "1.19").Replace("1.19_deep_dark_experimental_snapshot-", "Java版Deep_Dark_Experimental_Snapshot_")
ElseIf Id = "b1.9-pre6" Then
WikiName = "Java版Beta_1.9_Prerelease_6"
ElseIf Id.StartsWithF("1_18_experimental-snapshot-") OrElse Id.StartsWithF("1.18_experimental-snapshot-") Then
WikiName = "Java版" & Id.Replace("1_18_", "1.18-").Replace("experimental-snapshot-", "-exp")
ElseIf Id.Contains("b1.9") Then
WikiName = "Java版Beta_1.9_Prerelease"
WikiName = "Java版" & Id.Replace("b", "Beta_").Replace("-pre", "_Prerelease_")
ElseIf Id = "c0.30_01c" OrElse Id = "c0.30_survival" OrElse Id.Contains("生存测试") OrElse Id = "c0.30-1" OrElse Id = "c0.30-2" Then
WikiName = "Java版Classic_0.30(生存模式)"
ElseIf Id.StartsWithF("c0.31") OrElse Id = "in-20100130" Then
WikiName = "Java版Indev_0.31_20100130"
ElseIf Id = "b1.6-tb3" Then
WikiName = "Java版Beta_1.6_Test_Build_3"
ElseIf VersionJson("type") = "release" OrElse VersionJson("type") = "snapshot" OrElse VersionJson("type") = "special" Then
WikiName = If(Id.Contains("w"), "", "Java版") & Id.Replace(" Pre-Release ", "-pre")
ElseIf Id.StartsWithF("b") Then
WikiName = "Java版" & Id.TrimEnd("a", "b", "c", "d", "e").Replace("b", "Beta_")
WikiName = "Java版" & Id.TrimEnd("-1", "-2", "-3").Replace("b", "Beta_").Replace("tb3", "Test_Build_3")
ElseIf Id.StartsWithF("a") Then
WikiName = "Java版" & Id.TrimEnd("a", "b", "c", "d", "e").Replace("a", "Alpha_v")
ElseIf Id = "inf-20100618" Then
WikiName = "Java版Infdev_20100618"
ElseIf Id = "c0.30_01c" OrElse Id = "c0.30_survival" OrElse Id.Contains("生存测试") Then
WikiName = "Java版Classic_0.30(生存模式)"
ElseIf Id.StartsWithF("c0.31") Then
WikiName = "Java版Indev_0.31_20100130"
WikiName = "Java版" & Id.TrimEnd("-1", "-2", "-3").Replace("a", "Alpha_v")
ElseIf Id.StartsWithF("inf-") Then
WikiName = "Java版" & Id.TrimEnd("-1", "-2", "-3").Replace("inf-", "Infdev_")
ElseIf Id.StartsWithF("in-") Then
WikiName = "Java版" & Id.TrimEnd("-1", "-2", "-3", "-2103", "-2304").Replace("in-", "Indev_")
ElseIf Id.StartsWithF("c") Then
WikiName = "Java版" & Id.Replace("c", "Classic_")
WikiName = "Java版" & Id.TrimEnd("-1", "-2", "-3").Replace("c", "Classic_").Replace("st", "SURVIVAL_TEST")
ElseIf Id.StartsWithF("rd-") Then
WikiName = "Java版Pre-classic_" & Id
Else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
End If
'愚人节版本
Select Case Version("id").ToString.ToLower
Case "2point0_blue", "2point0_red", "2point0_purple"
Type = "愚人节版"
Version("id") = Version("id").ToString().Replace("point", ".")
Version("type") = "special"
Version.Add("lore", GetMcFoolName(Version("id")))
Case "20w14infinite", "20w14∞"
Type = "愚人节版"
Version("id") = "20w14∞"
Expand Down