diff --git a/README.md b/README.md index 3d9861f..213aa7c 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ First, you might have a try of the simple examples. It's a good start. ### Run Examples - Run `go run github.com/Tnze/go-mc/cmd/mcping localhost` to ping and list the localhost mc server. -- Run `go run github.com/Tnze/go-mc/cmd/daze` to join the local server at *localhost:25565* as Steve on the offline mode. +- Run `go run github.com/Tnze/go-mc/cmd/daze` to join the local server at *localhost:25565* as player named Daze on the offline mode. ### Basic Usage diff --git a/examples/daze/daze.go b/examples/daze/daze.go index 8662bd2..9ed57ac 100644 --- a/examples/daze/daze.go +++ b/examples/daze/daze.go @@ -121,6 +121,6 @@ func (d DisconnectErr) Error() string { } func onDisconnect(reason chat.Message) error { - // return a error value so that we can stop main loop + // return an error value so that we can stop main loop return DisconnectErr{Reason: reason} } diff --git a/net/packet/packet.go b/net/packet/packet.go index 80af644..3bfa370 100644 --- a/net/packet/packet.go +++ b/net/packet/packet.go @@ -121,6 +121,7 @@ func (p *Packet) packWithCompression(w io.Writer, threshold int) error { dataLength := bufPool.Get().(*bytes.Buffer) defer bufPool.Put(dataLength) + dataLength.Reset() n3, err := VarInt(int(n1) + n2).WriteTo(dataLength) if err != nil { return err