gpt4 book ai didi

VB.Net 自定义 Minecraft 启动器

转载 作者:行者123 更新时间:2023-12-02 11:15:45 25 4
gpt4 key购买 nike

我想在 VB.Net 中为我和我的 friend 创建我自己的 Minecraft 启动器。我有这段代码,它为我提供了访问 token 。

Private ACCESS_TOKEN As String
Public Function GetAccessToken() As String
Return ACCESS_TOKEN
End Function
Public Sub ObtainAccessToken()
Dim username As String = TextBox1.Text
Dim password As String = TextBox2.Text
Dim UUID As String = Guid.NewGuid.ToString()
Dim httpWebRequest = DirectCast(WebRequest.Create("https://authserver.mojang.com/authenticate"), HttpWebRequest)
httpWebRequest.ContentType = "application/json"
httpWebRequest.Method = "POST"

Using streamWriter = New StreamWriter(httpWebRequest.GetRequestStream())
Dim json As String = (Convert.ToString((Convert.ToString("{""agent"":{""name"":""Minecraft"",""version"":1},""username"":""") & username) + """,""password"":""") & password) + """,""clientToken"":" & ControlChars.Quote & UUID & ControlChars.Quote & "}"

streamWriter.Write(json)
streamWriter.Flush()
streamWriter.Close()

Dim httpResponse = DirectCast(httpWebRequest.GetResponse(), HttpWebResponse)
Using streamReader = New StreamReader(httpResponse.GetResponseStream())
Dim result = streamReader.ReadToEnd()
ACCESS_TOKEN = result
End Using
End Using
End Sub

但是我可以用这个访问 token 做什么?如何使用java参数直接启动minecraft?我想启动minecraft.jar文件。

最佳答案

在.minecraft文件夹中,所有参数都在version.json中

这是 1.8.8 版本 (.minecraft/versons/1.8.8) 中的 json 片段

"id": "1.8.8",
"time": "2016-06-01T07:45:48-04:00",
"releaseTime": "2015-07-27T06:31:28-04:00",
"type": "release",
"minecraftArguments": "--username ${auth_player_name} --version ${version_name} --gameDir ${game_directory} --assetsDir ${assets_root} --assetIndex ${assets_index_name} --uuid ${auth_uuid} --accessToken ${auth_access_token} --userProperties ${user_properties} --userType ${user_type}"

参数位于“minecraftArguments”下,jar 文件位于同一目录中,名为 1.8.8.jar。

关于VB.Net 自定义 Minecraft 启动器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50294556/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com