mc root source folder cleanup

This commit is contained in:
adman
2026-06-27 13:54:54 +02:00
parent b2784574bd
commit 666f250b3e
480 changed files with 325 additions and 325 deletions
+6 -6
View File
@@ -6,7 +6,7 @@ import (
"flag"
"os"
"github.com/admin-else/strom/api"
api2 "github.com/admin-else/strom/mc/api"
)
var cmd = flag.NewFlagSet("api", flag.ContinueOnError)
@@ -25,9 +25,9 @@ func Run(args []string) (err error) {
if err != nil {
return
}
a := &api.Account{}
a := &api2.Account{}
if *tokenFlag != "" {
a, err = api.NewAccountFromYGG(*tokenFlag)
a, err = api2.NewAccountFromYGG(*tokenFlag)
if err != nil {
return
}
@@ -40,14 +40,14 @@ func Run(args []string) (err error) {
}
} else if *uuidFlag != "" || *nameFlag != "" {
if *nameFlag != "" {
var idName api.IdName
idName, err = api.NameToId(*nameFlag)
var idName api2.IdName
idName, err = api2.NameToId(*nameFlag)
if err != nil {
return
}
*uuidFlag = idName.Id
}
data, err = api.Profile(*uuidFlag, *unsignedFlag)
data, err = api2.Profile(*uuidFlag, *unsignedFlag)
if err != nil {
return
}
+7 -7
View File
@@ -7,9 +7,9 @@ import (
"os"
"slices"
"github.com/admin-else/strom/data"
"github.com/admin-else/strom/proto_generated"
"github.com/admin-else/strom/util"
data2 "github.com/admin-else/strom/mc/data"
"github.com/admin-else/strom/mc/proto_generated"
"github.com/admin-else/strom/mc/util"
)
// strom data 1.21.11 blocks id 0 name => air
@@ -39,11 +39,11 @@ func Run(args []string) (err error) {
case 0: // print available versions
dataValues = proto_generated.SupportedVersions
case 1: // print available data for version
dataValues = slices.Collect(maps.Keys(data.Paths.Data[args[0]]))
dataValues = slices.Collect(maps.Keys(data2.Paths.Data[args[0]]))
case 2:
err = data.LoadVersionedJson(args[0], args[1], &dataValues)
err = data2.LoadVersionedJson(args[0], args[1], &dataValues)
case 3:
err = data.LoadVersionedJson(args[0], args[1], &dataValues)
err = data2.LoadVersionedJson(args[0], args[1], &dataValues)
if err != nil {
return
}
@@ -68,7 +68,7 @@ func Run(args []string) (err error) {
}
dataValues = result
case 4, 5:
err = data.LoadVersionedJson(args[0], args[1], &dataValues)
err = data2.LoadVersionedJson(args[0], args[1], &dataValues)
if err != nil {
return
}
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"log/slog"
"os"
"github.com/admin-else/strom/level/anvil"
"github.com/admin-else/strom/nbt"
"github.com/admin-else/strom/mc/level/anvil"
"github.com/admin-else/strom/mc/nbt"
)
var (
+16 -16
View File
@@ -7,12 +7,12 @@ import (
"log/slog"
"os"
"github.com/admin-else/strom/level"
"github.com/admin-else/strom/level/anvil"
"github.com/admin-else/strom/nbt"
"github.com/admin-else/strom/proto/replay"
"github.com/admin-else/strom/proto_generated/v1_21_11"
"github.com/admin-else/strom/util"
"github.com/admin-else/strom/mc/level"
anvil2 "github.com/admin-else/strom/mc/level/anvil"
nbt2 "github.com/admin-else/strom/mc/nbt"
"github.com/admin-else/strom/mc/proto/replay"
"github.com/admin-else/strom/mc/proto_generated/v1_21_11"
"github.com/admin-else/strom/mc/util"
)
var (
@@ -40,15 +40,15 @@ func init() {
}
func GetChunkFromMca(x, z int32, version string) (b []byte, err error) {
xmca := util.FloorDiv(x, anvil.ChunksWidthRegionFile)
zmca := util.FloorDiv(z, anvil.ChunksWidthRegionFile)
x = x % anvil.ChunksWidthRegionFile
xmca := util.FloorDiv(x, anvil2.ChunksWidthRegionFile)
zmca := util.FloorDiv(z, anvil2.ChunksWidthRegionFile)
x = x % anvil2.ChunksWidthRegionFile
if x < 0 {
x += anvil.ChunksWidthRegionFile
x += anvil2.ChunksWidthRegionFile
}
z = z % anvil.ChunksWidthRegionFile
z = z % anvil2.ChunksWidthRegionFile
if z < 0 {
z += anvil.ChunksWidthRegionFile
z += anvil2.ChunksWidthRegionFile
}
f, err := os.Open(fmt.Sprintf("./level/anvil/testdata/securechattestworld/region/r.%v.%v.mca", xmca, zmca))
@@ -56,12 +56,12 @@ func GetChunkFromMca(x, z int32, version string) (b []byte, err error) {
return
}
defer f.Close()
mca, err := anvil.ReadChunkHeader(f)
mca, err := anvil2.ReadChunkHeader(f)
if err != nil {
return
}
var n *nbt.Tag
var n *nbt2.Tag
n, err = mca.ChunkAt(f, x, z)
if err != nil {
return
@@ -70,8 +70,8 @@ func GetChunkFromMca(x, z int32, version string) (b []byte, err error) {
return
}
var chunk anvil.Chunk
err = nbt.Format.Decode(n.Value, &chunk)
var chunk anvil2.Chunk
err = nbt2.Format.Decode(n.Value, &chunk)
if err != nil {
return
}
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"flag"
"fmt"
"github.com/admin-else/strom/crypto"
"github.com/admin-else/strom/mc/crypto"
)
var cmd = flag.NewFlagSet("offline-uuid", flag.ContinueOnError)
+4 -4
View File
@@ -5,10 +5,10 @@ import (
"fmt"
"strconv"
"github.com/admin-else/strom/data"
"github.com/admin-else/strom/proto"
"github.com/admin-else/strom/proto_base"
"github.com/admin-else/strom/proto_generated"
"github.com/admin-else/strom/mc/data"
"github.com/admin-else/strom/mc/proto"
"github.com/admin-else/strom/mc/proto_base"
"github.com/admin-else/strom/mc/proto_generated"
)
var cmd = flag.NewFlagSet("packet-info", flag.ContinueOnError)
+21 -21
View File
@@ -7,15 +7,15 @@ import (
"os"
"time"
"github.com/admin-else/strom/api"
"github.com/admin-else/strom/client"
"github.com/admin-else/strom/event"
"github.com/admin-else/strom/nbt"
"github.com/admin-else/strom/proto"
"github.com/admin-else/strom/proto_base"
"github.com/admin-else/strom/proto_generated/v1_21_11"
"github.com/admin-else/strom/server"
"github.com/admin-else/strom/text"
api2 "github.com/admin-else/strom/mc/api"
client2 "github.com/admin-else/strom/mc/client"
"github.com/admin-else/strom/mc/event"
"github.com/admin-else/strom/mc/nbt"
proto2 "github.com/admin-else/strom/mc/proto"
"github.com/admin-else/strom/mc/proto_base"
"github.com/admin-else/strom/mc/proto_generated/v1_21_11"
server2 "github.com/admin-else/strom/mc/server"
"github.com/admin-else/strom/mc/text"
)
var Cmd = flag.NewFlagSet("packet-inspector", flag.ContinueOnError)
@@ -28,7 +28,7 @@ var ListenAddr = Cmd.String("listen", "127.0.0.1:25566", "address to listen on")
var TrueForward = Cmd.Bool("true-forward", false, "forward packets without modification -name and custom server status wont work")
type Proxy struct {
Client, Servee *proto.Conn
Client, Servee *proto2.Conn
Data nbt.Tag
}
@@ -74,7 +74,7 @@ func (p *Proxy) OnAnything(e event.Anything) (err error) {
if !ok {
return
}
packetInfo, ok := proto.LookupPacketInfoByType(packet)
packetInfo, ok := proto2.LookupPacketInfoByType(packet)
if !ok {
return
}
@@ -145,12 +145,12 @@ func (p *Proxy) OnCompress(packet *v1_21_11.LoginToClientPacketCompress) (err er
return
}
var StatusResponse = server.StatusResponse{
Version: server.StatusResponseVersion{
var StatusResponse = server2.StatusResponse{
Version: server2.StatusResponseVersion{
Name: text.Pretty("STROM"),
Protocol: 772,
},
Players: server.StatusResponsePlayers{},
Players: server2.StatusResponsePlayers{},
Description: text.Pretty("Packet spy forwards to " + *TargetAddr),
Favicon: "",
EnforcesSecureChat: false,
@@ -162,33 +162,33 @@ func Run(args []string) (err error) {
return
}
slog.Info("Starting packet inspector", "listen", *ListenAddr)
err = server.StartServerWithOnConn(*ListenAddr, func(serveeConn *proto.Conn) (err error) {
err = server2.StartServerWithOnConn(*ListenAddr, func(serveeConn *proto2.Conn) (err error) {
p := &Proxy{Servee: serveeConn, Client: nil}
var acc = api.NewOfflineAccount(*OfflineNameFlag)
var acc = api2.NewOfflineAccount(*OfflineNameFlag)
if !*TrueForward {
if *Token != "" {
acc, err = api.NewAccountFromYGG(*Token)
acc, err = api2.NewAccountFromYGG(*Token)
if err != nil {
return
}
}
_, err = server.ServeLogin(serveeConn, server.WithOtherAccount(acc), server.WithStatus(StatusResponse), server.WithoutOnlineMode(), server.WithoutEncryption())
_, err = server2.ServeLogin(serveeConn, server2.WithOtherAccount(acc), server2.WithStatus(StatusResponse), server2.WithoutOnlineMode(), server2.WithoutEncryption())
if err != nil {
return
}
}
*TargetAddr, err = client.DoDnsSimple(*TargetAddr)
*TargetAddr, err = client2.DoDnsSimple(*TargetAddr)
if err != nil {
return
}
c, err := client.Connect(*TargetAddr)
c, err := client2.Connect(*TargetAddr)
if err != nil {
return
}
defer c.Close()
if !*TrueForward {
err = client.LoginRaw(c, acc)
err = client2.LoginRaw(c, acc)
if err != nil {
return
}
+3 -3
View File
@@ -7,7 +7,7 @@ import (
"fmt"
"os"
"github.com/admin-else/strom/nbt"
nbt2 "github.com/admin-else/strom/mc/nbt"
)
var (
@@ -29,14 +29,14 @@ func Run(args []string) (err error) {
return
}
defer f.Close()
n, err := nbt.ReadUnstructuredFile(f)
n, err := nbt2.ReadUnstructuredFile(f)
if err != nil {
return
}
var b []byte
if *HashFormatFlag {
bb := bytes.NewBuffer(nil)
err = nbt.PrintSNBTAny(n.Value, bb)
err = nbt2.PrintSNBTAny(n.Value, bb)
if err != nil {
return
}
+8 -8
View File
@@ -14,9 +14,9 @@ import (
"reflect"
"strings"
"github.com/admin-else/strom/data"
"github.com/admin-else/strom/proto"
"github.com/admin-else/strom/proto_base"
"github.com/admin-else/strom/mc/data"
proto2 "github.com/admin-else/strom/mc/proto"
"github.com/admin-else/strom/mc/proto_base"
)
var (
@@ -32,7 +32,7 @@ var (
//go:embed failed_packet.go.tmpl
var TestSrcF string
func SaveUnCodeAbleAsTest(packet *proto.UnCodablePacket) {
func SaveUnCodeAbleAsTest(packet *proto2.UnCodablePacket) {
hUntrimmed := sha256.Sum256(packet.Data)
h := hUntrimmed[:8]
f, err := os.Create(fmt.Sprintf(*CreateTestsPath+"/%v_%10x_test.go", len(packet.Data), h))
@@ -87,15 +87,15 @@ func UnpackPacket(r io.Reader) (packet proto_base.EncodeDecodeAble, err error) {
// indexafterid represents how many bytes we've read so far
indexafterid := int(b.Size()) - b.Len()
i, ok := proto.LookUpTypeByPacketInfo(proto_base.ToClient, state, packetId, int32(*ProtocolVersion))
i, ok := proto2.LookUpTypeByPacketInfo(proto_base.ToClient, state, packetId, int32(*ProtocolVersion))
if !ok {
packet = &proto.UnCodablePacket{Err: proto.BadPacketIdErr, Data: packetData, Info: i}
packet = &proto2.UnCodablePacket{Err: proto2.BadPacketIdErr, Data: packetData, Info: i}
return
}
packet = reflect.New(reflect.TypeOf(i.Type).Elem()).Interface().(proto_base.EncodeDecodeAble)
err = packet.Decode(b)
if err != nil {
packet = &proto.UnCodablePacket{Err: err, Data: packetData[indexafterid:], Info: i}
packet = &proto2.UnCodablePacket{Err: err, Data: packetData[indexafterid:], Info: i}
return
}
switch i.Name {
@@ -138,7 +138,7 @@ func Run(args []string) (err error) {
for {
var packet proto_base.EncodeDecodeAble
packet, err = UnpackPacket(f)
unCodablePacket, ok := packet.(*proto.UnCodablePacket)
unCodablePacket, ok := packet.(*proto2.UnCodablePacket)
if ok {
if *CreateTestsPath != "" {
SaveUnCodeAbleAsTest(unCodablePacket)
+19 -19
View File
@@ -6,16 +6,16 @@ import (
"log/slog"
"os"
"github.com/admin-else/strom/api"
"github.com/admin-else/strom/client"
"github.com/admin-else/strom/data"
"github.com/admin-else/strom/event"
"github.com/admin-else/strom/nbt"
"github.com/admin-else/strom/proto"
"github.com/admin-else/strom/proto_base"
"github.com/admin-else/strom/proto_generated/v1_21_8"
"github.com/admin-else/strom/server"
"github.com/admin-else/strom/text"
"github.com/admin-else/strom/mc/api"
"github.com/admin-else/strom/mc/client"
"github.com/admin-else/strom/mc/data"
"github.com/admin-else/strom/mc/event"
nbt2 "github.com/admin-else/strom/mc/nbt"
proto2 "github.com/admin-else/strom/mc/proto"
"github.com/admin-else/strom/mc/proto_base"
"github.com/admin-else/strom/mc/proto_generated/v1_21_8"
server2 "github.com/admin-else/strom/mc/server"
"github.com/admin-else/strom/mc/text"
)
func wontFail[T any](v T, err error) T {
@@ -33,8 +33,8 @@ var (
FinishedConfigErr = errors.New("finished configuration")
)
var Status = wontFail(json.Marshal(server.StatusResponse{
Version: server.StatusResponseVersion{
var Status = wontFail(json.Marshal(server2.StatusResponse{
Version: server2.StatusResponseVersion{
Name: nil,
Protocol: CompatibleProtocolVersion,
},
@@ -42,8 +42,8 @@ var Status = wontFail(json.Marshal(server.StatusResponse{
}))
type Proxy struct {
Client, Servee *proto.Conn
Data *nbt.Tag
Client, Servee *proto2.Conn
Data *nbt2.Tag
}
func (p *Proxy) OnAnything(e event.Anything) (err error) {
@@ -51,7 +51,7 @@ func (p *Proxy) OnAnything(e event.Anything) (err error) {
if !ok {
return
}
packetInfo, ok := proto.LookupPacketInfoByType(packet)
packetInfo, ok := proto2.LookupPacketInfoByType(packet)
if !ok {
return
}
@@ -107,10 +107,10 @@ func (p *Proxy) OnTags(data *v1_21_8.ConfigurationToClientPacketTags) (err error
return
}
func handleClient(c *proto.Conn) (err error) {
func handleClient(c *proto2.Conn) (err error) {
acc := api.NewOfflineAccount("RegistryHunter")
_, err = server.ServeLogin(c, server.WithOtherAccount(acc), server.WithCompatibleVersions(CompatibleProtocolVersion), server.WithRawStatus(Status))
_, err = server2.ServeLogin(c, server2.WithOtherAccount(acc), server2.WithCompatibleVersions(CompatibleProtocolVersion), server2.WithRawStatus(Status))
if err != nil {
return
}
@@ -141,12 +141,12 @@ func handleClient(c *proto.Conn) (err error) {
return
}
defer f.Close()
err = nbt.WriteUnstructuredFile(f, p.Data)
err = nbt2.WriteUnstructuredFile(f, p.Data)
slog.Info("saved", "file", SaveAs)
return
}
func Run(args []string) error {
slog.SetLogLoggerLevel(slog.LevelDebug)
return server.StartServerWithOnConn(":25566", handleClient)
return server2.StartServerWithOnConn(":25566", handleClient)
}
+8 -8
View File
@@ -9,11 +9,11 @@ import (
"os"
"time"
"github.com/admin-else/strom/event"
"github.com/admin-else/strom/proto"
"github.com/admin-else/strom/proto/replay"
"github.com/admin-else/strom/proto_generated/v1_21_8"
"github.com/admin-else/strom/server"
"github.com/admin-else/strom/mc/event"
"github.com/admin-else/strom/mc/proto"
"github.com/admin-else/strom/mc/proto/replay"
"github.com/admin-else/strom/mc/proto_generated/v1_21_8"
server2 "github.com/admin-else/strom/mc/server"
)
type Server struct {
@@ -30,12 +30,12 @@ var (
func Limbo(c *proto.Conn, tmcprPath string) (err error) {
s := &Server{Conn: c}
_, err = server.ServeLogin(s.Conn, server.WithoutOnlineMode())
_, err = server2.ServeLogin(s.Conn, server2.WithoutOnlineMode())
if err != nil {
return
}
err = server.ServeConfig(s.Conn)
err = server2.ServeConfig(s.Conn)
if err != nil {
return
}
@@ -91,7 +91,7 @@ func Run(args []string) error {
return nil
}
return server.StartServerWithOnConn(*bindAddr, func(c *proto.Conn) error {
return server2.StartServerWithOnConn(*bindAddr, func(c *proto.Conn) error {
return Limbo(c, *tmcprFile)
})
}
+21 -21
View File
@@ -8,14 +8,14 @@ import (
"os"
"time"
"github.com/admin-else/strom/event"
"github.com/admin-else/strom/level"
"github.com/admin-else/strom/level/anvil"
"github.com/admin-else/strom/nbt"
"github.com/admin-else/strom/proto"
"github.com/admin-else/strom/proto_generated/v1_21_8"
"github.com/admin-else/strom/server"
"github.com/admin-else/strom/util"
"github.com/admin-else/strom/mc/event"
"github.com/admin-else/strom/mc/level"
anvil2 "github.com/admin-else/strom/mc/level/anvil"
nbt2 "github.com/admin-else/strom/mc/nbt"
"github.com/admin-else/strom/mc/proto"
"github.com/admin-else/strom/mc/proto_generated/v1_21_8"
server2 "github.com/admin-else/strom/mc/server"
"github.com/admin-else/strom/mc/util"
)
type Server struct {
@@ -41,15 +41,15 @@ func init() {
}
func GetChunkFromMca(x, z int32, version string) (b []byte, err error) {
xmca := util.FloorDiv(x, anvil.ChunksWidthRegionFile)
zmca := util.FloorDiv(z, anvil.ChunksWidthRegionFile)
x = x % anvil.ChunksWidthRegionFile
xmca := util.FloorDiv(x, anvil2.ChunksWidthRegionFile)
zmca := util.FloorDiv(z, anvil2.ChunksWidthRegionFile)
x = x % anvil2.ChunksWidthRegionFile
if x < 0 {
x += anvil.ChunksWidthRegionFile
x += anvil2.ChunksWidthRegionFile
}
z = z % anvil.ChunksWidthRegionFile
z = z % anvil2.ChunksWidthRegionFile
if z < 0 {
z += anvil.ChunksWidthRegionFile
z += anvil2.ChunksWidthRegionFile
}
f, err := os.Open(fmt.Sprintf("./level/anvil/testdata/securechattestworld/region/r.%v.%v.mca", xmca, zmca))
@@ -57,12 +57,12 @@ func GetChunkFromMca(x, z int32, version string) (b []byte, err error) {
return
}
defer f.Close()
mca, err := anvil.ReadChunkHeader(f)
mca, err := anvil2.ReadChunkHeader(f)
if err != nil {
return
}
var n *nbt.Tag
var n *nbt2.Tag
n, err = mca.ChunkAt(f, x, z)
if err != nil {
return
@@ -71,8 +71,8 @@ func GetChunkFromMca(x, z int32, version string) (b []byte, err error) {
return
}
var chunk anvil.Chunk
err = nbt.Format.Decode(n.Value, &chunk)
var chunk anvil2.Chunk
err = nbt2.Format.Decode(n.Value, &chunk)
if err != nil {
return
}
@@ -95,12 +95,12 @@ func Limbo(c *proto.Conn) (err error) {
s := &Server{
Conn: c,
}
_, err = server.ServeLogin(s.Conn, server.WithoutOnlineMode())
_, err = server2.ServeLogin(s.Conn, server2.WithoutOnlineMode())
if err != nil {
return
}
err = server.ServeConfig(s.Conn)
err = server2.ServeConfig(s.Conn)
if err != nil {
return
}
@@ -176,5 +176,5 @@ func (s *Server) SendKeepAlive() (err error) {
func Run(args []string) error {
slog.SetLogLoggerLevel(slog.LevelDebug)
return server.StartServerWithOnConn(":25566", Limbo)
return server2.StartServerWithOnConn(":25566", Limbo)
}
+8 -8
View File
@@ -6,11 +6,11 @@ import (
"log/slog"
"time"
"github.com/admin-else/strom/client"
"github.com/admin-else/strom/event"
"github.com/admin-else/strom/proto"
"github.com/admin-else/strom/proto_base"
"github.com/admin-else/strom/proto_generated/v1_21_8"
client2 "github.com/admin-else/strom/mc/client"
"github.com/admin-else/strom/mc/event"
"github.com/admin-else/strom/mc/proto"
"github.com/admin-else/strom/mc/proto_base"
"github.com/admin-else/strom/mc/proto_generated/v1_21_8"
)
var cmd = flag.NewFlagSet("status", flag.ContinueOnError)
@@ -46,7 +46,7 @@ func (s *StatusClient) OnPong(p *v1_21_8.StatusToClientPacketPing) (err error) {
// So ignore the resource leak warning. And maybe attach a warn ignore comment.
// It does not resolve SRV records.
func StatusRaw(addr string) (s *StatusClient, err error) {
c, err := client.ConnectVersionLess(addr)
c, err := client2.ConnectVersionLess(addr)
if err != nil {
return
}
@@ -61,7 +61,7 @@ func StatusRaw(addr string) (s *StatusClient, err error) {
s.RegisterCriticalUntilLatest(s.OnStatus)
s.RegisterCriticalUntilLatest(s.OnPong)
p, err := client.MakeHandshakePacketAddr(s.Conn, proto_base.Status, addr)
p, err := client2.MakeHandshakePacketAddr(s.Conn, proto_base.Status, addr)
if err != nil {
return
}
@@ -82,7 +82,7 @@ func Run(args []string) (err error) {
return
}
if *srvFlag {
*addrFlag, err = client.DoDnsSimple(*addrFlag)
*addrFlag, err = client2.DoDnsSimple(*addrFlag)
if err != nil {
return
}
View File
+3 -1
View File
@@ -1,6 +1,8 @@
package api
import "github.com/admin-else/strom/crypto"
import (
"github.com/admin-else/strom/mc/crypto"
)
func NewOfflineAccount(name string) *Account {
return &Account{
+2 -2
View File
@@ -4,8 +4,8 @@ import (
"context"
"net"
"github.com/admin-else/strom/proto"
"github.com/admin-else/strom/proto_base"
"github.com/admin-else/strom/mc/proto"
"github.com/admin-else/strom/mc/proto_base"
)
// Connect connects to the given address note that it does not resolve the SRV records it's just a raw net.Dial
@@ -4,10 +4,10 @@ import (
"errors"
"fmt"
"github.com/admin-else/strom/event"
"github.com/admin-else/strom/proto"
"github.com/admin-else/strom/proto_base"
"github.com/admin-else/strom/proto_generated/v1_21_8"
"github.com/admin-else/strom/mc/event"
"github.com/admin-else/strom/mc/proto"
"github.com/admin-else/strom/mc/proto_base"
"github.com/admin-else/strom/mc/proto_generated/v1_21_8"
)
type ConfigIgnorer struct {
View File
@@ -4,9 +4,9 @@ import (
"net"
"strconv"
"github.com/admin-else/strom/proto"
"github.com/admin-else/strom/proto_base"
"github.com/admin-else/strom/proto_generated/v1_21_8"
"github.com/admin-else/strom/mc/proto"
"github.com/admin-else/strom/mc/proto_base"
"github.com/admin-else/strom/mc/proto_generated/v1_21_8"
)
func MakeHandshakePacket(c *proto.Conn, nextState proto_base.State) (p *v1_21_8.HandshakingToServerPacketSetProtocol, err error) {
+7 -8
View File
@@ -7,14 +7,13 @@ import (
"encoding/json"
"errors"
"github.com/admin-else/strom/api"
"github.com/admin-else/strom/crypto"
"github.com/admin-else/strom/event"
"github.com/admin-else/strom/proto"
"github.com/admin-else/strom/proto_base"
"github.com/admin-else/strom/text"
"github.com/admin-else/strom/proto_generated/v1_21_8"
"github.com/admin-else/strom/mc/api"
"github.com/admin-else/strom/mc/crypto"
"github.com/admin-else/strom/mc/event"
"github.com/admin-else/strom/mc/proto"
"github.com/admin-else/strom/mc/proto_base"
"github.com/admin-else/strom/mc/proto_generated/v1_21_8"
"github.com/admin-else/strom/mc/text"
)
type LoginClient struct {
+5 -6
View File
@@ -5,12 +5,11 @@ import (
"encoding/json"
"time"
"github.com/admin-else/strom/event"
"github.com/admin-else/strom/proto"
"github.com/admin-else/strom/proto_base"
"github.com/admin-else/strom/server"
"github.com/admin-else/strom/proto_generated/v1_21_8"
"github.com/admin-else/strom/mc/event"
"github.com/admin-else/strom/mc/proto"
"github.com/admin-else/strom/mc/proto_base"
"github.com/admin-else/strom/mc/proto_generated/v1_21_8"
"github.com/admin-else/strom/mc/server"
)
type StatusClient struct {
@@ -3,7 +3,7 @@ package data_test
import (
"testing"
"github.com/admin-else/strom/data"
"github.com/admin-else/strom/mc/data"
)
func TestLookupBiomeById(t *testing.T) {
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"slices"
"strconv"
"github.com/admin-else/strom/util"
"github.com/admin-else/strom/mc/util"
)
// {
@@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/admin-else/strom/data"
"github.com/admin-else/strom/mc/data"
)
func TestLookupBlockByStateId(t *testing.T) {
View File
View File
@@ -3,7 +3,7 @@ package data_test
import (
"testing"
"github.com/admin-else/strom/data"
"github.com/admin-else/strom/mc/data"
)
func TestLookUpProtocolVersion(t *testing.T) {
+3 -3
View File
@@ -3,7 +3,7 @@ package data
import (
"embed"
"github.com/admin-else/strom/nbt"
nbt2 "github.com/admin-else/strom/mc/nbt"
)
// TODO: this is stupid loginPacket.json exists next version migrate to that
@@ -11,12 +11,12 @@ import (
//go:embed registry/*
var Registry embed.FS
func LoadRegistry(name string) (n *nbt.Tag, err error) {
func LoadRegistry(name string) (n *nbt2.Tag, err error) {
r, err := Registry.Open("registry/" + name + ".nbt")
if err != nil {
return
}
defer r.Close()
n, err = nbt.ReadUnstructuredFile(r)
n, err = nbt2.ReadUnstructuredFile(r)
return
}

Some files were not shown because too many files have changed in this diff Show More