Add 1.21.2 & 1.21.0 support

This commit is contained in:
AkmalFairuz
2025-01-01 13:40:15 +07:00
parent 123f125d4e
commit f6548dd6a7
29 changed files with 7641 additions and 7 deletions

View File

@@ -0,0 +1,29 @@
package legacypacket
import (
"github.com/akmalfairuz/legacy-version/legacyver/proto"
"github.com/sandertv/gophertunnel/minecraft/nbt"
"github.com/sandertv/gophertunnel/minecraft/protocol"
"github.com/sandertv/gophertunnel/minecraft/protocol/packet"
)
// EditorNetwork is a packet sent from the server to the client and vise-versa to communicate editor-mode related
// information. It carries a single compound tag containing the relevant information.
type EditorNetwork struct {
// RouteToManager ...
RouteToManager bool
// Payload is a network little endian compound tag holding data relevant to the editor.
Payload map[string]any
}
// ID ...
func (*EditorNetwork) ID() uint32 {
return packet.IDEditorNetwork
}
func (pk *EditorNetwork) Marshal(io protocol.IO) {
if proto.IsProtoGTE(io, proto.ID712) {
io.Bool(&pk.RouteToManager)
}
io.NBT(&pk.Payload, nbt.NetworkLittleEndian)
}