update dependencies
This commit is contained in:
parent
bb7e53e870
commit
a771b5f1d8
|
@ -4,6 +4,7 @@ token.json
|
||||||
*.mcpack
|
*.mcpack
|
||||||
*.zip
|
*.zip
|
||||||
*.pcap
|
*.pcap
|
||||||
|
*.pcap2
|
||||||
*.bmp
|
*.bmp
|
||||||
*.bin
|
*.bin
|
||||||
*.log
|
*.log
|
||||||
|
|
4
go.mod
4
go.mod
|
@ -3,7 +3,7 @@ module github.com/bedrock-tool/bedrocktool
|
||||||
go 1.19
|
go 1.19
|
||||||
|
|
||||||
//replace github.com/sandertv/gophertunnel => ./gophertunnel
|
//replace github.com/sandertv/gophertunnel => ./gophertunnel
|
||||||
replace github.com/sandertv/gophertunnel => github.com/olebeck/gophertunnel v1.24.11-1
|
replace github.com/sandertv/gophertunnel => github.com/olebeck/gophertunnel v1.24.13-1
|
||||||
|
|
||||||
//replace github.com/df-mc/dragonfly => ./dragonfly
|
//replace github.com/df-mc/dragonfly => ./dragonfly
|
||||||
replace github.com/df-mc/dragonfly => github.com/olebeck/dragonfly v0.8.5-1
|
replace github.com/df-mc/dragonfly => github.com/olebeck/dragonfly v0.8.5-1
|
||||||
|
@ -29,7 +29,7 @@ require (
|
||||||
github.com/df-mc/atomic v1.10.0 // indirect
|
github.com/df-mc/atomic v1.10.0 // indirect
|
||||||
github.com/golang/protobuf v1.5.2 // indirect
|
github.com/golang/protobuf v1.5.2 // indirect
|
||||||
github.com/golang/snappy v0.0.4 // indirect
|
github.com/golang/snappy v0.0.4 // indirect
|
||||||
github.com/google/uuid v1.3.0 // indirect
|
github.com/google/uuid v1.3.0
|
||||||
github.com/jinzhu/copier v0.3.5
|
github.com/jinzhu/copier v0.3.5
|
||||||
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect
|
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect
|
||||||
github.com/klauspost/compress v1.15.11 // indirect
|
github.com/klauspost/compress v1.15.11 // indirect
|
||||||
|
|
2
go.sum
2
go.sum
|
@ -56,6 +56,8 @@ github.com/olebeck/dragonfly v0.8.5-1 h1:+z1WO0W4jCc1jcPMGDz85AxLWz59haEakD0yAVE
|
||||||
github.com/olebeck/dragonfly v0.8.5-1/go.mod h1:CHQ21j4LjSwHgUeMk06tcxEW6U+SI7avLCUeSvp9AXo=
|
github.com/olebeck/dragonfly v0.8.5-1/go.mod h1:CHQ21j4LjSwHgUeMk06tcxEW6U+SI7avLCUeSvp9AXo=
|
||||||
github.com/olebeck/gophertunnel v1.24.11-1 h1:DKEqjK5nAcjlwejHAD/SHeolAM6y9EkyjJcMuoK7VVY=
|
github.com/olebeck/gophertunnel v1.24.11-1 h1:DKEqjK5nAcjlwejHAD/SHeolAM6y9EkyjJcMuoK7VVY=
|
||||||
github.com/olebeck/gophertunnel v1.24.11-1/go.mod h1:dYFetA6r62huhc1EgR9p8VFAFtKOuGgVE/iXf5CzZ4o=
|
github.com/olebeck/gophertunnel v1.24.11-1/go.mod h1:dYFetA6r62huhc1EgR9p8VFAFtKOuGgVE/iXf5CzZ4o=
|
||||||
|
github.com/olebeck/gophertunnel v1.24.13-1 h1:3Sj22hVFAGCnPMJAewoSeuC9N8ikzcWo0DvJNBnXvs0=
|
||||||
|
github.com/olebeck/gophertunnel v1.24.13-1/go.mod h1:dYFetA6r62huhc1EgR9p8VFAFtKOuGgVE/iXf5CzZ4o=
|
||||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||||
github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs=
|
github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs=
|
||||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||||
|
|
|
@ -56,6 +56,7 @@ type WorldState struct {
|
||||||
chunks map[protocol.ChunkPos]*chunk.Chunk
|
chunks map[protocol.ChunkPos]*chunk.Chunk
|
||||||
blockNBT map[protocol.SubChunkPos][]map[string]any
|
blockNBT map[protocol.SubChunkPos][]map[string]any
|
||||||
openItemContainers map[byte]*itemContainer
|
openItemContainers map[byte]*itemContainer
|
||||||
|
airRid uint32
|
||||||
|
|
||||||
Dim world.Dimension
|
Dim world.Dimension
|
||||||
WorldName string
|
WorldName string
|
||||||
|
@ -82,6 +83,7 @@ func NewWorldState() *WorldState {
|
||||||
Dim: nil,
|
Dim: nil,
|
||||||
WorldName: "world",
|
WorldName: "world",
|
||||||
PlayerPos: TPlayerPos{},
|
PlayerPos: TPlayerPos{},
|
||||||
|
airRid: 6692,
|
||||||
}
|
}
|
||||||
w.ui = NewMapUI(w)
|
w.ui = NewMapUI(w)
|
||||||
return w
|
return w
|
||||||
|
@ -169,13 +171,11 @@ func (c *WorldCMD) Execute(ctx context.Context, f *flag.FlagSet, _ ...interface{
|
||||||
return pk, nil
|
return pk, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
defer w.SaveAndReset()
|
|
||||||
|
|
||||||
err = proxy.Run(ctx, server_address)
|
err = proxy.Run(ctx, server_address)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintln(os.Stderr, err)
|
fmt.Fprintln(os.Stderr, err)
|
||||||
return 1
|
|
||||||
}
|
}
|
||||||
|
w.SaveAndReset()
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,7 +197,7 @@ func (w *WorldState) ProcessLevelChunk(pk *packet.LevelChunk) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
ch, blockNBTs, err := chunk.NetworkDecode(6692, pk.RawPayload, int(pk.SubChunkCount), w.Dim.Range(), w.ispre118)
|
ch, blockNBTs, err := chunk.NetworkDecode(w.airRid, pk.RawPayload, int(pk.SubChunkCount), w.Dim.Range(), w.ispre118)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Error(err)
|
logrus.Error(err)
|
||||||
return
|
return
|
||||||
|
@ -308,7 +308,7 @@ func (w *WorldState) Reset() {
|
||||||
|
|
||||||
// writes the world to a folder, resets all the chunks
|
// writes the world to a folder, resets all the chunks
|
||||||
func (w *WorldState) SaveAndReset() {
|
func (w *WorldState) SaveAndReset() {
|
||||||
logrus.Infof("Saving world %s", w.WorldName)
|
logrus.Infof("Saving world %s %d chunks", w.WorldName, len(w.chunks))
|
||||||
|
|
||||||
// open world
|
// open world
|
||||||
folder := path.Join("worlds", fmt.Sprintf("%s/%s", w.ServerName, w.WorldName))
|
folder := path.Join("worlds", fmt.Sprintf("%s/%s", w.ServerName, w.WorldName))
|
||||||
|
@ -461,14 +461,15 @@ func (w *WorldState) OnConnect(proxy *utils.ProxyContext) {
|
||||||
w.proxy = proxy
|
w.proxy = proxy
|
||||||
gd := w.proxy.Server.GameData()
|
gd := w.proxy.Server.GameData()
|
||||||
|
|
||||||
/*
|
if len(gd.CustomBlocks) > 0 {
|
||||||
if len(gd.CustomBlocks) > 0 {
|
logrus.Info("Using Custom Blocks")
|
||||||
|
/*
|
||||||
for _, be := range gd.CustomBlocks {
|
for _, be := range gd.CustomBlocks {
|
||||||
b := block.ServerCustomBlock(be)
|
b := block.ServerCustomBlock(be)
|
||||||
world.RegisterBlock(b)
|
world.RegisterBlock(b)
|
||||||
}
|
}
|
||||||
}
|
*/
|
||||||
*/
|
}
|
||||||
|
|
||||||
if w.withPacks {
|
if w.withPacks {
|
||||||
go func() {
|
go func() {
|
||||||
|
@ -526,7 +527,7 @@ func (w *WorldState) OnConnect(proxy *utils.ProxyContext) {
|
||||||
Parameters: []protocol.CommandParameter{
|
Parameters: []protocol.CommandParameter{
|
||||||
{
|
{
|
||||||
Name: "name",
|
Name: "name",
|
||||||
Type: protocol.CommandArgTypeFilepath,
|
Type: protocol.CommandArgTypeString,
|
||||||
Optional: false,
|
Optional: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -13,6 +13,7 @@ import (
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/google/uuid"
|
||||||
"github.com/sandertv/gophertunnel/minecraft"
|
"github.com/sandertv/gophertunnel/minecraft"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
|
|
||||||
|
@ -81,10 +82,12 @@ func ConnectServer(ctx context.Context, address string, ClientData *login.Client
|
||||||
|
|
||||||
logrus.Infof("Connecting to %s\n", address)
|
logrus.Infof("Connecting to %s\n", address)
|
||||||
serverConn, err = minecraft.Dialer{
|
serverConn, err = minecraft.Dialer{
|
||||||
TokenSource: GetTokenSource(),
|
TokenSource: GetTokenSource(),
|
||||||
ClientData: cd,
|
ClientData: cd,
|
||||||
PacketFunc: packet_func,
|
PacketFunc: packet_func,
|
||||||
DownloadPacks: want_packs,
|
DownloadResourcePack: func(id uuid.UUID, version string) bool {
|
||||||
|
return want_packs
|
||||||
|
},
|
||||||
}.DialContext(ctx, "raknet", address)
|
}.DialContext(ctx, "raknet", address)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in New Issue