diff --git a/README.md b/README.md index 1841758..5fd5e88 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Go-MC -![](https://img.shields.io/badge/Minecraft-1.14.3-blue.svg) -![](https://img.shields.io/badge/Protocol-490-blue.svg) +![](https://img.shields.io/badge/Minecraft-1.14.4-blue.svg) +![](https://img.shields.io/badge/Protocol-497-blue.svg) [![GoDoc](https://godoc.org/github.com/Tnze/go-mc?status.svg)](https://godoc.org/github.com/Tnze/go-mc) [![Go Report Card](https://goreportcard.com/badge/github.com/Tnze/go-mc)](https://goreportcard.com/report/github.com/Tnze/go-mc) [![Build Status](https://travis-ci.org/Tnze/go-mc.svg?branch=master)](https://travis-ci.org/Tnze/go-mc) @@ -11,7 +11,7 @@ There's some library in Go support you to create your Minecraft client or server - [x] Parse NBT - [x] Simple MC robot lib - [x] Mojang authenticate -- [x] Minecraft network protocal +- [x] Minecraft network protocol - [ ] World container / encoding bot: @@ -40,4 +40,4 @@ After you install golang tools: - Run `go run cmd/ping/ping.go localhost` to ping and list the Miaoscraft mc-server. - Run `go run cmd/daze/daze.go` to join local server at *localhost:25565* as Steve on offline mode. -See `/bot` folder to get more infomation about how to create your own robot. \ No newline at end of file +See `/bot` folder to get more information about how to create your own robot. \ No newline at end of file diff --git a/bot/ingame.go b/bot/ingame.go index 6606698..11ae4df 100644 --- a/bot/ingame.go +++ b/bot/ingame.go @@ -67,7 +67,7 @@ func (c *Client) handlePacket(p pk.Packet) (disconnect bool, err error) { err = handleSpawnPositionPacket(c, p) case data.PlayerAbilitiesClientbound: err = handlePlayerAbilitiesPacket(c, p) - c.conn.WritePacket( + _ = c.conn.WritePacket( //ClientSettings packet (serverbound) pk.Marshal( data.ClientSettings, @@ -138,7 +138,7 @@ func handleSoundEffect(c *Client, p pk.Packet) error { } if c.Events.SoundPlay != nil { - c.Events.SoundPlay( + err = c.Events.SoundPlay( data.SoundNames[SoundID], int(SoundCategory), float64(x)/8, float64(y)/8, float64(z)/8, float32(Volume), float32(Pitch)) @@ -160,7 +160,7 @@ func handleNamedSoundEffect(c *Client, p pk.Packet) error { } if c.Events.SoundPlay != nil { - c.Events.SoundPlay( + err = c.Events.SoundPlay( string(SoundName), int(SoundCategory), float64(x)/8, float64(y)/8, float64(z)/8, float32(Volume), float32(Pitch)) diff --git a/bot/mcbot.go b/bot/mcbot.go index 22b3913..4a01789 100644 --- a/bot/mcbot.go +++ b/bot/mcbot.go @@ -13,7 +13,7 @@ import ( ) // ProtocolVersion , the protocol version number of minecraft net protocol -const ProtocolVersion = 490 +const ProtocolVersion = 497 // PingAndList check server status and list online player. // Returns a JSON data with server status, and the delay. diff --git a/data/blocks.go b/data/blocks.go index cc984f2..364700e 100644 --- a/data/blocks.go +++ b/data/blocks.go @@ -35,6 +35,7 @@ func init() { const blockStatesLen = 11270 + 1 +// TODO: check updates of block status var blockStatesJSON = ` { "minecraft:air": { diff --git a/data/en_us.go b/data/en_us.go index 89251f6..21a8d0a 100644 --- a/data/en_us.go +++ b/data/en_us.go @@ -1,5 +1,7 @@ package data +//TODO: check updates en_us translation + // EnUs , the default language translate data // When update this data, replace "%[0-9]\$s" with "%[0-9]s" var EnUs = map[string]string{ diff --git a/data/items.go b/data/items.go index 6110b26..6dd6219 100644 --- a/data/items.go +++ b/data/items.go @@ -17,6 +17,7 @@ func init() { } } +//TODO: check updates itemIDS var itemIDsJSON = ` { "minecraft:air": { "protocol_id": 0 diff --git a/data/packetIDs.go b/data/packetIDs.go index 7ea34b3..f003c20 100644 --- a/data/packetIDs.go +++ b/data/packetIDs.go @@ -1,6 +1,6 @@ package data -//Clientbound packet IDs +// Clientbound packet IDs const ( SpawnObject byte = iota //0x00 SpawnExperienceOrb @@ -98,10 +98,11 @@ const ( EntityProperties EntityEffect DeclareRecipes - Tags //0x5B + Tags + AcknowledgePlayerDigging //0x5C ) -//Serverbound packet IDs +// Serverbound packet IDs const ( TeleportConfirm byte = iota //0x00 QueryBlockNBT diff --git a/data/soundIDs.go b/data/soundIDs.go index cf5f667..1e4288d 100644 --- a/data/soundIDs.go +++ b/data/soundIDs.go @@ -1,5 +1,7 @@ package data +//TODO: check updates sound names + //SoundNames match the sound IDs' name var SoundNames = []string{ "ambient.cave",