Tnze / go-mc

Collection of Go libraries for Minecraft
https://go-mc.github.io/tutorial/
MIT License
858 stars 115 forks source link

1.20 #250

Closed 223225zzzkkk closed 6 months ago

223225zzzkkk commented 1 year ago

Update to 1.20

223225zzzkkk commented 1 year ago

我没有改动任何代码,目前可以直接连接1.20服务器,跟平常一样

994AK commented 1 year ago

我好像并没有链接 1.20服务器 提示我:2023/06/16 16:44:43 bot: encrypt start error: EOF exit status 1

`package main

import ( "log"

"github.com/Tnze/go-mc/bot"
// mcnet "github.com/Tnze/go-mc/net"

)

func main() {

// 第一步:创建客户端
client := bot.NewClient()

// 第二步:设置玩家名
client.Auth.Name = "MyBot"

// 第三步:省略,因为我们不进行正版验证

// 第四步:加入游戏,这里用你自己的服务器地址替换
err := client.JoinServer("66aserver.zhongbai233.top")
if err != nil {
    log.Fatal(err)
}

log.Println("Login success")

// 第五步:处理游戏
for {
    if err = client.HandleGame(); err != nil {
        // 如果出现错误,我们在这里记录错误,并重新开始
        log.Printf("Error: %v", err)
    }
}

} `

theoparis commented 10 months ago

Not sure if this should be in the same issue, but there is now a 1.20.4 protocol and it says this library only supports 1.20.2 👀

Tnze commented 10 months ago

Who says?

Tnze commented 10 months ago

And yes, this lib only support 1.20.2 now.

Tnze commented 6 months ago

We upgraded to 1.20.4