trans README
This commit is contained in:
@ -5,6 +5,7 @@
|
|||||||
[](https://goreportcard.com/report/github.com/Tnze/go-mc)
|
[](https://goreportcard.com/report/github.com/Tnze/go-mc)
|
||||||
|
|
||||||
There's some library in Go support you to create your Minecraft client or server.
|
There's some library in Go support you to create your Minecraft client or server.
|
||||||
|
这是一些Golang库,用于帮助你编写自己的Minecraft客户端或服务器,
|
||||||
- [x] Mojang authenticate
|
- [x] Mojang authenticate
|
||||||
- [x] Minecraft network protocal
|
- [x] Minecraft network protocal
|
||||||
- [x] Parse chat message
|
- [x] Parse chat message
|
||||||
@ -12,6 +13,7 @@ There's some library in Go support you to create your Minecraft client or server
|
|||||||
- [ ] Parse NBT
|
- [ ] Parse NBT
|
||||||
|
|
||||||
Some examples are at `/cmd` folder.
|
Some examples are at `/cmd` folder.
|
||||||
|
有一些例子在cmd目录下
|
||||||
|
|
||||||
> `1.13.2` version is at [gomcbot](https://github.com/Tnze/gomcbot).
|
> `1.13.2` version is at [gomcbot](https://github.com/Tnze/gomcbot).
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package authenticate
|
package authenticate
|
||||||
|
|
||||||
|
//Simple yggdrasil-minecraft-login method.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
@ -31,9 +31,9 @@ type jsonChat struct {
|
|||||||
//UnmarshalJSON decode json to Message
|
//UnmarshalJSON decode json to Message
|
||||||
func (m *Message) UnmarshalJSON(jsonMsg []byte) (err error) {
|
func (m *Message) UnmarshalJSON(jsonMsg []byte) (err error) {
|
||||||
if jsonMsg[0] == '"' {
|
if jsonMsg[0] == '"' {
|
||||||
err = json.Unmarshal(jsonMsg, &m.Text)
|
err = json.Unmarshal(jsonMsg, &m.Text) //Unmarshal as jsonString
|
||||||
} else {
|
} else {
|
||||||
err = json.Unmarshal(jsonMsg, (*jsonChat)(m))
|
err = json.Unmarshal(jsonMsg, (*jsonChat)(m)) //Unmarshal as jsonChat
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user