fix player chat fort error

This commit is contained in:
Tnze
2022-12-04 16:08:52 +08:00
parent 089d12e36b
commit ff94c600df
4 changed files with 12 additions and 13 deletions

View File

@ -3,10 +3,9 @@ package basic
import ( import (
"unsafe" "unsafe"
"github.com/Tnze/go-mc/registry"
"github.com/Tnze/go-mc/data/packetid" "github.com/Tnze/go-mc/data/packetid"
pk "github.com/Tnze/go-mc/net/packet" pk "github.com/Tnze/go-mc/net/packet"
"github.com/Tnze/go-mc/registry"
) )
// WorldInfo content player info in server. // WorldInfo content player info in server.

View File

@ -10,15 +10,15 @@ type Decoration struct {
TranslationKey string `nbt:"translation_key"` TranslationKey string `nbt:"translation_key"`
Parameters []string `nbt:"parameters"` Parameters []string `nbt:"parameters"`
Style struct { Style struct {
Bold bool `nbt:"bold"` Bold bool `nbt:"bold,omitempty"`
Italic bool `nbt:"italic"` Italic bool `nbt:"italic,omitempty"`
UnderLined bool `nbt:"underlined"` UnderLined bool `nbt:"underlined,omitempty"`
StrikeThrough bool `nbt:"strikethrough"` StrikeThrough bool `nbt:"strikethrough,omitempty"`
Obfuscated bool `nbt:"obfuscated"` Obfuscated bool `nbt:"obfuscated,omitempty"`
Color string `nbt:"color"` Color string `nbt:"color,omitempty"`
Insertion string `nbt:"insertion"` Insertion string `nbt:"insertion,omitempty"`
Font string `nbt:"font"` Font string `nbt:"font,omitempty"`
} `nbt:"style"` } `nbt:"style,omitempty"`
} }
type Type struct { type Type struct {

View File

@ -22,7 +22,7 @@ import (
) )
var ( var (
address = flag.String("address", "127.0.0.1:25566", "The server address") address = flag.String("address", "127.0.0.1:25565", "The server address")
name = flag.String("name", "Daze", "The player's name") name = flag.String("name", "Daze", "The player's name")
playerID = flag.String("uuid", "", "The player's UUID") playerID = flag.String("uuid", "", "The player's UUID")
accessToken = flag.String("token", "", "AccessToken") accessToken = flag.String("token", "", "AccessToken")

View File

@ -83,7 +83,7 @@ func (s *scanner) eof() int {
return scanEnd return scanEnd
} }
if s.errContext == "" { if s.errContext == "" {
s.errContext = "unexpected end of JSON input" s.errContext = "unexpected end of SNBT input"
} }
return scanError return scanError
} }