remove gomcbot

This commit is contained in:
JunDao
2019-05-02 14:17:53 +08:00
parent 6cd0af6187
commit 603ab9b09d
6 changed files with 2 additions and 74 deletions

View File

@ -9,7 +9,6 @@ import (
"github.com/Tnze/go-mc/chat"
"github.com/Tnze/go-mc/data"
pk "github.com/Tnze/go-mc/net/packet"
// "github.com/Tnze/gomcbot/world/entity"
)
// //GetPosition return the player's position

View File

@ -167,7 +167,7 @@ func loginAuth(AsTk, name, UUID string, shareSecret []byte, er encryptionRequest
if err != nil {
return fmt.Errorf("make request error: %v", err)
}
PostRequest.Header.Set("User-Agent", "gomcbot")
PostRequest.Header.Set("User-Agent", "go-mc")
PostRequest.Header.Set("Connection", "keep-alive")
resp, err := client.Do(PostRequest)
if err != nil {

View File

@ -1,67 +0,0 @@
package cmd
import (
"fmt"
bot "github.com/Tnze/gomcbot"
auth "github.com/Tnze/gomcbot/util/authenticate"
)
func ExamplePingAndList() {
resp, err := bot.PingAndList("localhost", 25565)
if err != nil {
panic(err)
}
// see format of resp at https://wiki.vg/Server_List_Ping#Response
fmt.Println(resp)
}
func Example_joinOfflineServer() {
c := bot.NewClient()
err := c.JoinServer("jdao.online", 25566)
if err != nil {
panic(err)
}
//Handle game
// events := game.GetEvents()
// go game.HandleGame()
// for e := range events { //Reciving events
// switch e.(type) {
// case bot.PlayerSpawnEvent:
// fmt.Println("Player is spawned!")
// }
// }
}
func Example_joinOnlineServer() {
c := bot.NewClient()
//Login
// This is the basic authenticate function.
// Maybe you could get more control of login process by using
// https://github.com/JoshuaDoes/go-yggdrasil.
resp, err := auth.Authenticate("email", "password")
if err != nil {
panic(err)
}
c.Auth = resp.ToAuth()
//Join server
err = c.JoinServer("localhost", 25565)
if err != nil {
panic(err)
}
//Handle game
// events := game.GetEvents()
// go game.HandleGame()
// for e := range events { //Reciving events
// switch e.(type) {
// case bot.PlayerSpawnEvent:
// fmt.Println("Player is spawned!")
// }
// }
}

View File

@ -1,7 +1,7 @@
package main
import (
bot "github.com/Tnze/gomcbot"
"github.com/Tnze/go-mc/bot"
"log"
)

2
go.mod
View File

@ -1,5 +1,3 @@
module github.com/Tnze/go-mc
go 1.12
require github.com/Tnze/gomcbot v0.0.0-20190428125515-3d2883562e1d

2
go.sum
View File

@ -1,2 +0,0 @@
github.com/Tnze/gomcbot v0.0.0-20190428125515-3d2883562e1d h1:EnNxILaQhPa7kITN7A2s2xc1rd0ly+xNcGNxC9sm26g=
github.com/Tnze/gomcbot v0.0.0-20190428125515-3d2883562e1d/go.mod h1:qH9H+ek0PFB3oy6PPPwbidkHLvha/mpNeR9YxT+Qdjo=