This commit is contained in:
Tnze
2022-11-17 00:32:38 +08:00
parent 7a2b3da584
commit 3e83d1dbca
8 changed files with 9 additions and 9 deletions

View File

@ -118,7 +118,7 @@ for i := 0; i < int(WorldCount); i++ {
} }
``` ```
But this is tediously long an not compatible with `p.Scan()` method. But this is tediously long and not compatible with `p.Scan()` method.
In the latest version, two new types is added: `pk.Ary` and `pk.Opt`. Dedicated to handling "Array of ...." and " In the latest version, two new types is added: `pk.Ary` and `pk.Opt`. Dedicated to handling "Array of ...." and "
Optional ...." fields. Optional ...." fields.

View File

@ -20,7 +20,7 @@ func ExamplePingAndList() {
func ExampleClient_JoinServer_offline() { func ExampleClient_JoinServer_offline() {
c := NewClient() c := NewClient()
c.Auth.Name = "Tnze" // set it's name before login. c.Auth.Name = "Tnze" // set its name before login.
id := offline.NameToUUID(c.Auth.Name) // optional, get uuid of offline mode game id := offline.NameToUUID(c.Auth.Name) // optional, get uuid of offline mode game
c.Auth.UUID = hex.EncodeToString(id[:]) c.Auth.UUID = hex.EncodeToString(id[:])

View File

@ -21,7 +21,7 @@ type registry struct {
} }
//go:embed registries.json //go:embed registries.json
var registeriesJson []byte var registersJson []byte
//go:embed template.go.tmpl //go:embed template.go.tmpl
var tempSource string var tempSource string
@ -45,7 +45,7 @@ var temp = template.Must(template.
func main() { func main() {
var registries map[string]registry var registries map[string]registry
if err := json.Unmarshal(registeriesJson, &registries); err != nil { if err := json.Unmarshal(registersJson, &registries); err != nil {
log.Fatal(err) log.Fatal(err)
} }

View File

@ -6,7 +6,7 @@ const (
scanContinue = iota // uninteresting byte scanContinue = iota // uninteresting byte
scanBeginLiteral // end implied by next result != scanContinue scanBeginLiteral // end implied by next result != scanContinue
scanBeginCompound // begin TAG_Compound (after left-brace ) scanBeginCompound // begin TAG_Compound (after left-brace )
scanBeginList // begin TAG_List (after left-brack) scanBeginList // begin TAG_List (after left-bracket)
scanListValue // just finished read list value (after comma) scanListValue // just finished read list value (after comma)
scanListType // just finished read list type (after "B;" or "L;") scanListType // just finished read list type (after "B;" or "L;")
scanCompoundTagName // just finished read tag name (before colon) scanCompoundTagName // just finished read tag name (before colon)

View File

@ -2,7 +2,7 @@ package realms
import "fmt" import "fmt"
// Invite invite player to Realm // Invite player to Realm
func (r *Realms) Invite(s Server, name, uuid string) error { func (r *Realms) Invite(s Server, name, uuid string) error {
pl := struct { pl := struct {
Name string `json:"name"` Name string `json:"name"`

View File

@ -8,7 +8,7 @@ func (r *Realms) Available() (ok bool, err error) {
return return
} }
// Compatible returns whether the clients version is up to date with Realms. // Compatible returns whether the clients version is up-to-date with Realms.
// //
// if the client is outdated, it returns OUTDATED, // if the client is outdated, it returns OUTDATED,
// if the client is running a snapshot, it returns OTHER, // if the client is running a snapshot, it returns OTHER,

View File

@ -23,7 +23,7 @@ func (e *Error) Error() string {
} }
// Domain is the URL of Realms API server // Domain is the URL of Realms API server
// Panic if it cannot be parse by url.Parse(). // Panic if it cannot be parsed by url.Parse().
var Domain = "https://pc.realms.minecraft.net" var Domain = "https://pc.realms.minecraft.net"
// New create a new Realms c with version, username, accessToken and UUID without dashes. // New create a new Realms c with version, username, accessToken and UUID without dashes.

View File

@ -221,7 +221,7 @@ func (r *Region) WriteSector(x, z int, data []byte) error {
return nil return nil
} }
// ExistSector return if a sector is exist // ExistSector return if a sector is existed
func (r *Region) ExistSector(x, z int) bool { func (r *Region) ExistSector(x, z int) bool {
return r.offsets[z][x] != 0 return r.offsets[z][x] != 0
} }