From 3e83d1dbcab65b6c08b693298b3ce093970b4c46 Mon Sep 17 00:00:00 2001 From: Tnze Date: Thu, 17 Nov 2022 00:32:38 +0800 Subject: [PATCH] fix typo --- README.md | 2 +- bot/example_test.go | 2 +- data/registry/generate.go | 4 ++-- nbt/snbt_scanner.go | 2 +- realms/invite.go | 2 +- realms/mco.go | 2 +- realms/realms.go | 2 +- save/region/mca.go | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index dffbc7d..5fb81f1 100644 --- a/README.md +++ b/README.md @@ -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 " Optional ...." fields. diff --git a/bot/example_test.go b/bot/example_test.go index 623439c..5c90564 100644 --- a/bot/example_test.go +++ b/bot/example_test.go @@ -20,7 +20,7 @@ func ExamplePingAndList() { func ExampleClient_JoinServer_offline() { 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 c.Auth.UUID = hex.EncodeToString(id[:]) diff --git a/data/registry/generate.go b/data/registry/generate.go index 52fcc4a..73e8e4f 100644 --- a/data/registry/generate.go +++ b/data/registry/generate.go @@ -21,7 +21,7 @@ type registry struct { } //go:embed registries.json -var registeriesJson []byte +var registersJson []byte //go:embed template.go.tmpl var tempSource string @@ -45,7 +45,7 @@ var temp = template.Must(template. func main() { var registries map[string]registry - if err := json.Unmarshal(registeriesJson, ®istries); err != nil { + if err := json.Unmarshal(registersJson, ®istries); err != nil { log.Fatal(err) } diff --git a/nbt/snbt_scanner.go b/nbt/snbt_scanner.go index e29c2dd..4ddafa2 100644 --- a/nbt/snbt_scanner.go +++ b/nbt/snbt_scanner.go @@ -6,7 +6,7 @@ const ( scanContinue = iota // uninteresting byte scanBeginLiteral // end implied by next result != scanContinue 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) scanListType // just finished read list type (after "B;" or "L;") scanCompoundTagName // just finished read tag name (before colon) diff --git a/realms/invite.go b/realms/invite.go index 48fe2b0..f069b13 100644 --- a/realms/invite.go +++ b/realms/invite.go @@ -2,7 +2,7 @@ package realms import "fmt" -// Invite invite player to Realm +// Invite player to Realm func (r *Realms) Invite(s Server, name, uuid string) error { pl := struct { Name string `json:"name"` diff --git a/realms/mco.go b/realms/mco.go index a2e628f..ab503c5 100644 --- a/realms/mco.go +++ b/realms/mco.go @@ -8,7 +8,7 @@ func (r *Realms) Available() (ok bool, err error) { 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 running a snapshot, it returns OTHER, diff --git a/realms/realms.go b/realms/realms.go index 327bc1f..23b40c5 100644 --- a/realms/realms.go +++ b/realms/realms.go @@ -23,7 +23,7 @@ func (e *Error) Error() string { } // 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" // New create a new Realms c with version, username, accessToken and UUID without dashes. diff --git a/save/region/mca.go b/save/region/mca.go index 9efbc21..dbefa0f 100644 --- a/save/region/mca.go +++ b/save/region/mca.go @@ -221,7 +221,7 @@ func (r *Region) WriteSector(x, z int, data []byte) error { return nil } -// ExistSector return if a sector is exist +// ExistSector return if a sector is existed func (r *Region) ExistSector(x, z int) bool { return r.offsets[z][x] != 0 }