升级到1.14.4

This commit is contained in:
Tnze
2019-07-20 02:13:26 +08:00
parent 2809be4542
commit a1cc368be2
8 changed files with 18 additions and 11 deletions

View File

@ -1,6 +1,6 @@
# Go-MC # Go-MC
![](https://img.shields.io/badge/Minecraft-1.14.3-blue.svg) ![](https://img.shields.io/badge/Minecraft-1.14.4-blue.svg)
![](https://img.shields.io/badge/Protocol-490-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) [![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) [![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) [![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] Parse NBT
- [x] Simple MC robot lib - [x] Simple MC robot lib
- [x] Mojang authenticate - [x] Mojang authenticate
- [x] Minecraft network protocal - [x] Minecraft network protocol
- [ ] World container / encoding - [ ] World container / encoding
bot: 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/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. - 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. See `/bot` folder to get more information about how to create your own robot.

View File

@ -67,7 +67,7 @@ func (c *Client) handlePacket(p pk.Packet) (disconnect bool, err error) {
err = handleSpawnPositionPacket(c, p) err = handleSpawnPositionPacket(c, p)
case data.PlayerAbilitiesClientbound: case data.PlayerAbilitiesClientbound:
err = handlePlayerAbilitiesPacket(c, p) err = handlePlayerAbilitiesPacket(c, p)
c.conn.WritePacket( _ = c.conn.WritePacket(
//ClientSettings packet (serverbound) //ClientSettings packet (serverbound)
pk.Marshal( pk.Marshal(
data.ClientSettings, data.ClientSettings,
@ -138,7 +138,7 @@ func handleSoundEffect(c *Client, p pk.Packet) error {
} }
if c.Events.SoundPlay != nil { if c.Events.SoundPlay != nil {
c.Events.SoundPlay( err = c.Events.SoundPlay(
data.SoundNames[SoundID], int(SoundCategory), data.SoundNames[SoundID], int(SoundCategory),
float64(x)/8, float64(y)/8, float64(z)/8, float64(x)/8, float64(y)/8, float64(z)/8,
float32(Volume), float32(Pitch)) float32(Volume), float32(Pitch))
@ -160,7 +160,7 @@ func handleNamedSoundEffect(c *Client, p pk.Packet) error {
} }
if c.Events.SoundPlay != nil { if c.Events.SoundPlay != nil {
c.Events.SoundPlay( err = c.Events.SoundPlay(
string(SoundName), int(SoundCategory), string(SoundName), int(SoundCategory),
float64(x)/8, float64(y)/8, float64(z)/8, float64(x)/8, float64(y)/8, float64(z)/8,
float32(Volume), float32(Pitch)) float32(Volume), float32(Pitch))

View File

@ -13,7 +13,7 @@ import (
) )
// ProtocolVersion , the protocol version number of minecraft net protocol // ProtocolVersion , the protocol version number of minecraft net protocol
const ProtocolVersion = 490 const ProtocolVersion = 497
// PingAndList check server status and list online player. // PingAndList check server status and list online player.
// Returns a JSON data with server status, and the delay. // Returns a JSON data with server status, and the delay.

View File

@ -35,6 +35,7 @@ func init() {
const blockStatesLen = 11270 + 1 const blockStatesLen = 11270 + 1
// TODO: check updates of block status
var blockStatesJSON = ` var blockStatesJSON = `
{ {
"minecraft:air": { "minecraft:air": {

View File

@ -1,5 +1,7 @@
package data package data
//TODO: check updates en_us translation
// EnUs , the default language translate data // EnUs , the default language translate data
// When update this data, replace "%[0-9]\$s" with "%[0-9]s" // When update this data, replace "%[0-9]\$s" with "%[0-9]s"
var EnUs = map[string]string{ var EnUs = map[string]string{

View File

@ -17,6 +17,7 @@ func init() {
} }
} }
//TODO: check updates itemIDS
var itemIDsJSON = ` { var itemIDsJSON = ` {
"minecraft:air": { "minecraft:air": {
"protocol_id": 0 "protocol_id": 0

View File

@ -1,6 +1,6 @@
package data package data
//Clientbound packet IDs // Clientbound packet IDs
const ( const (
SpawnObject byte = iota //0x00 SpawnObject byte = iota //0x00
SpawnExperienceOrb SpawnExperienceOrb
@ -98,10 +98,11 @@ const (
EntityProperties EntityProperties
EntityEffect EntityEffect
DeclareRecipes DeclareRecipes
Tags //0x5B Tags
AcknowledgePlayerDigging //0x5C
) )
//Serverbound packet IDs // Serverbound packet IDs
const ( const (
TeleportConfirm byte = iota //0x00 TeleportConfirm byte = iota //0x00
QueryBlockNBT QueryBlockNBT

View File

@ -1,5 +1,7 @@
package data package data
//TODO: check updates sound names
//SoundNames match the sound IDs' name //SoundNames match the sound IDs' name
var SoundNames = []string{ var SoundNames = []string{
"ambient.cave", "ambient.cave",